# Update in Mongo

**URL:** <https://community.n8n.io/t/update-in-mongo/122428>\
**Category:** Questions\
**Tags:** mongodb\
**Created:** [May 28, 2025, 3:51pm UTC](https://community.n8n.io/t/update-in-mongo/122428 "2025-05-28T15:51:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sfedosej](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/sfedosej/32/84984_2.png) [@sfedosej](https://community.n8n.io/u/sfedosej)\
**Post date:** [May 28, 2025, 3:51pm UTC](https://community.n8n.io/t/update-in-mongo/122428/1 "2025-05-28T15:51:50Z")

</div>

I use the update function, when I select the update key, which is nested in mong, the data is not updated

 ![Screenshot 2025-05-28 225131](https://europe1.discourse-cdn.com/n8n/original/3X/f/5/f5a87417e2847047a8811fb4b6d53cd3f44850a0.png)

---

<div class="post-metadata">

**Author:** ![hubschrauber](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/hubschrauber/32/46788_2.png) [@hubschrauber](https://community.n8n.io/u/hubschrauber)\
**Post date:** [May 28, 2025, 4:45pm UTC](https://community.n8n.io/t/update-in-mongo/122428/2 "2025-05-28T16:45:39Z")

</div>

I think you might need to add the `Use Dot Notation` option to your node to get this working.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/2/b/2b75538cfff521e0dc25da8d807b8e837828530c.png)

---

<div class="post-metadata">

**Author:** ![sfedosej](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/sfedosej/32/84984_2.png) [@sfedosej](https://community.n8n.io/u/sfedosej)\
**Post date:** [May 28, 2025, 5:53pm UTC](https://community.n8n.io/t/update-in-mongo/122428/3 "2025-05-28T17:53:55Z")

</div>

unfortunately it didn’t help

---

<div class="post-metadata">

**Author:** ![King\_Samuel\_David](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/king_samuel_david/32/83690_2.png) [@King\_Samuel\_David](https://community.n8n.io/u/King_Samuel_David)\
**Post date:** [May 28, 2025, 6:04pm UTC](https://community.n8n.io/t/update-in-mongo/122428/4 "2025-05-28T18:04:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sfedosej](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/sfedosej/32/84984_2.png) [@sfedosej](https://community.n8n.io/u/sfedosej)\
**Post date:** [May 28, 2025, 6:29pm UTC](https://community.n8n.io/t/update-in-mongo/122428/5 "2025-05-28T18:29:48Z")

</div>

Hi!  
Input:

```auto
[

{

"_id": "gggg",

"verified": {

"email": true,

"phone": false

},

"profile": {

"email": "email@bk.ru",

"name": "name",

"surname": "",

"agreement": false,

"middlename": "",

"login": "login"

}}]

```

Output looks like this:  
[

{

}

]

I would be grateful if  
you could help.

---

<div class="post-metadata">

**Author:** ![hubschrauber](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/hubschrauber/32/46788_2.png) [@hubschrauber](https://community.n8n.io/u/hubschrauber)\
**Post date:** [May 29, 2025, 4:20pm UTC](https://community.n8n.io/t/update-in-mongo/122428/6 "2025-05-29T16:20:45Z")

</div>

The support for dot-notation on an update in the `MongoDB` node is full of quirks and odd side-effects.

### Alternative, More Reliable Approach

1. Load the existing MongoDB document/object by query, which will include the `_id` field/value
2. Modify/add whatever fields you need to, even in nested documents.
3. Update using `Key` → `_id`, specifying/including all root-level `Fields`
  - Get the list of all root-level fields except `_id` with an expression like:  
`{{ $json.keys().filter((key) => ['id','_id'].indexOf(key) === -1).join(',') }}`

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [August 27, 2025, 4:21pm UTC](https://community.n8n.io/t/update-in-mongo/122428/7 "2025-08-27T16:21:39Z")

</div>

Closed on August 27, 2025, 4:21pm UTC

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