MongoDB node

Describe the question

Is it possible to append data in MongoDB using the node?

Say I have inserted the following entry in my database

{
“_id”: {
“$oid”: “68e3b50812d86c5e8fc4ba8a”
},
“phone_number”: “123456789”,
“exchanges”: [
{
“user”: “Hi”,
“assistant”: “Hi! What would you like to discuss today?”,
“ts”: “06/10/25 14:24”
}
]
}

Now I want to append this entry so that when the user sends another message and gets a reply back it will be saved as

{
“_id”: {
“$oid”: “68e3b50812d86c5e8fc4ba8a”
},
“phone_number”: “123456789”,
“exchanges”: [
{
“user”: “Hi”,
“assistant”: “Hi! What would you like to discuss today?”,
“ts”: “06/10/25 14:24”
},

{
“user”: “2nd message”,
“assistant”: “2nd reply”,
“ts”: “2nd timestamp”
}
]
}

Would this be possible to do with the MongoDB node or do I need something else?

Please share your workflow

Share the output returned by the last node

I’ve been trying to get it to work for over 2 weeks now with the help of chatpt so I have way too many error codes etc that I have accumulated over the past 2 weeks lol

Information on your n8n setup

  • n8n version: Self hosted (should be the most recent one)
  • Database : MongoDB
  • n8n EXECUTIONS_PROCESS setting (default: own, main): idk?
  • Running n8n via (Docker, npm, n8n cloud, desktop app): selfhosted
  • Operating system: Windows

Hello @Ozz123, you can use Update Documents operation in the MongoDB node.
Something like that

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