Is possible to update MongoDB Documents using a filter and map the fields with my context fields?

I want to update mongodb documents using a filter, similar the filter used in find operation, and I’d like to map the update fields with my context variables, is that possible?

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:

hello @Murilo_Faria

Can you please provide an example of what you have and what you are trying to achieve?

Hi @barn4k,

What I want to do is a way to update using a filter in where, something like what is done by find operation:

image

And the fields to update I think should be possible to map with my variables, something like this:

I have the variables above, then I’d like to do the following:

{“IdStatus”: {{ $json.pedido.IdStatus }} }

I thought about making my own custom node to do this operation.

I suppose you need to use the Find operation to get the entity ID and then the Update operation for that ID you have found previously. As I do not see other ways to accomplish this.

I made my own node and worked

Thanks

1 Like