I use the update function, when I select the update key, which is nested in mong, the data is not updated
unfortunately it didn’t help
Hey @sfedosej
Are you seeing any error when running or seems like it completes okay but the data isn’t showing? If you do get an error I can try help further troubleshoot it.
Best regards,
Samuel
Hi!
Input:
[
{
"_id": "gggg",
"verified": {
"email": true,
"phone": false
},
"profile": {
"email": "[email protected]",
"name": "name",
"surname": "",
"agreement": false,
"middlename": "",
"login": "login"
}}]
Output looks like this:
[
{
}
]
I would be grateful if
you could help.
The support for dot-notation on an update in the MongoDB
node is full of quirks and odd side-effects.
Alternative, More Reliable Approach
- Load the existing MongoDB document/object by query, which will include the
_id
field/value - Modify/add whatever fields you need to, even in nested documents.
- Update using
Key
→_id
, specifying/including all root-levelFields
- Get the list of all root-level fields except
_id
with an expression like:
{{ $json.keys().filter((key) => ['id','_id'].indexOf(key) === -1).join(',') }}
- Get the list of all root-level fields except
1 Like