MongoDB Find & Update A Sub-doc Without Replacing Adjacent Data

Perhaps I’m mis-reading the Mongo docs but it should be possible to find and update a MongoDB subfield without wiping adjacent fields using dot notation. Otherwise, I have to update the entire sub-doc so nothing gets deleted. Am I missing something about how n8n implements Mongo?

When I execute the workflow below, the existing data in “users” gets replaced with the updated “city”.

Information on your n8n setup

1 Like

Interestingly, if I disable “Use Dot Notation” in the updating MongoDB node, the “city” field is saved correctly without wiping the adjacent data but it’s value is null.

1 Like

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