MongoDB Update - Need help with expression syntax

Describe the problem/error/question

I need to update a simple description field in MongoDB based on the _id but the record never gets updated.

Method: Update

Update key:

{ "_id": "{{ $('MongoDB').item.json._id }}" }

Fields:

{"description":"text"}

What is the error message (if any)?

No error message. The process completes successfully but the record is not updated

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: [email protected]
  • Database MongoDB:
  • Running n8n via n8n cloud
  • Operating system: Mac

The fields where you have entered raw MongoDB query syntax are only looking for a name or list of names to reference from the input item. The node wraps everything up internally into MongoDB query syntax for you. This is how it is supposed to work:

1 Like

Thank you! Problem solved.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.