I would like to push a value into mongodb document

I would like to push a new username into this document’s usernames field using mongodb:

{
  "_id": {
    "$oid": "65e9ccf6b072820ad0a611df"
  },
  "chatID": "test",
  " usernames": [
    {
      "username": "test",
      "lastState": 0
    },
    {
      "username": "test2",
      "lastState": 0
    }
  ]
}

but i have no idea how to do this properly,

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

hello @Mohammed_Hadi

I suppose that should be done via something like this

Thanks for taking time to reply, what I did as a workaround is request the usernamea modify it (add a new username) and then update the mongodb field, since the node doest support the $push functionality.