N8n mongo db document update using multiple fields

I am using the MongoDB Find and Update node to update data. I want to update documents by filtering on two keys in the collection. However, when I try to do this, it does not update. But when I try to update using only one key, it works. Any solution for this?

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

n8n version : 1.63.4
Running n8n Via n8n Cloud

hello @Susampath

That’s because update Key should be one key. It doesn’t accept two+ keys

@barn4k Is there any way where we can use two keys for filtering?

Each table row in mongoDB has a unique primary key _id which you can use.

Hello @barn4k,
Totally agree with your point. We can update a collection document by _id, but there are scenarios where we need to update documents using other selected keys. In that case, we have to use a Find node to get the _id, and then, as the next step, update the MongoDB document due to the limitations in n8n.

I think @n8n should facilitate this feature, as it is a very commonly used scenario when dealing with CRUD operations.

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