MongoDB Insert and Update

My requirement is to insert a record in MongoDB if no id key column is found. If an id key is found, perform an update operation. If I use MongoDB “Find & Replace” or “Find and Update” records are not getting inserted. Can you provide a resolution? See my workflow below:

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @Siva_Manickam, can you confirm how exactly the JSON data you’re sending to your MongoDB1 node looks like?