MongoDB node update key doesn't seem to support dot notation

Describe the problem/error/question

MongoDB node update key doesn’t seem to support dot notation. I’m trying to use the node’s ‘Find and Update’ operation and setting Update Key to profile._email. It won’t find any documents by this key. I also have Use Dot Notation enabled.

What is the error message (if any)?

No error message. Just an empty output.

Please share your workflow

  "meta": {
    "instanceId": "5154940e748bd1f69d9f0fc392aa0cc778fdac6909978070fda1ccee64c352cc"
  },
  "nodes": [
    {
      "parameters": {
        "operation": "findOneAndUpdate",
        "collection": "users",
        "updateKey": "profile._email",
        "fields": "cv, profile, pca, vs, files",
        "upsert": true,
        "options": {}
      },
      "id": "307cc52e-2024-4c46-87fb-dd0665b33495",
      "name": "upsertUser",
      "type": "n8n-nodes-base.mongoDb",
      "typeVersion": 1.1,
      "position": [
        5920,
        1020
      ],
      "alwaysOutputData": true,
      "credentials": {
        "mongoDb": {
          "id": "vGFwHpAB4KAPgI12",
          "name": "atlas_dev"
        }
      }
    }
  ],
  "connections": {},
  "pinData": {}
}

Share the output returned by the last node

[
  {}
]

Information on your n8n setup

  • n8n version: 1.53.2
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running N8N via: npm
  • Operating system: MacOS

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:

I’ve updated the question with all the relevant data.

Actually, I think the MongoDB node’s ‘Update’ and ‘Find and Update’ operations either don’t work at all or are not properly documented.

I can’t manage to update an existing doc. The proper way to use the ‘Update Key’ field is unclear to me, but I’ve tried both id and _id to try to find the document to update, and I tried both the ‘Update’ and ‘Find and Update’ operations without succes. BTW, the difference between these two operations is also not entirely clear. The documentation for the MongoDB node could be way better.

Hi @mig82

Can you share a bit more about your setup? What’s the structure of your MongoDB collection that you are trying to update?

Reminds me of a similar post - perhaps this could help?