MongoDB - Find & Update ( Fields attribute)

How do I set up the “fields” attribute in MongoDB Find and Update node to update all fields of the MongoDB collection?

In my case, the input JSON to the MongoDB Find and Update node is below. If I specify the Update Key as “SKU” and enter the “fields” attribute with values “SKU, Desc, Name, Test, Test 2, Test 3”, the find and update node functions properly, however, I don’t want to specify the fields individually. I want to set the expression so that the entire JSON is updated without specifying each field separately. Please see attached screenshot

[

{

“SKU”:“SKU1234”,

“Desc”:“Ganesh”,

"Name ":“Name Desc”,

“Test”:“Test fast”,

“Test 2”:“Test Test 2”,

“Test 3”:“Test Test 3”

},

{

“SKU”:“SKU2345”,

“Desc”:“John”,

"Name ":“Pleasework”,

“Test”:“Test fast”,

“Test 2”:“Test Test 2”,

“Test 3”:“Test Test 3”

},

{

“SKU”:“SKU3456”,

“Desc”:“Murga”,

"Name ":“Thomas”,

“Test”:“Test 2”,

“Test 2”:“Test Test 2”,

“Test 3”:“Test Test 3”

},

{

“SKU”:“SKU3457”,

“Desc”:“Ganesh”,

"Name ":“Thomas”,

“Test”:“Test 2”,

“Test 2”:“Test Test 2”,

“Test 3”:“Test Test 3”

}

]

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 - thanks for reaching out about this and sorry about the delay in response!

What you’re looking to do unfortunately at the moment is a feature request. I’ve moved this topic over to the right forum where our Product team can take a look at it :+1:

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