MOngodb Node in n8n failing to update documents with data from google sheets

  • Hello, I’m facing an issue with the MongoDB node in my n8n workflow that is failing to update documents. Here’s the detailed scenario:

Scenario Overview:

I am building an n8n workflow that performs the following steps:

  1. Search MongoDB for documents that meet specific criteria (i.e., non-empty documents).

  2. Retrieve these documents from MongoDB.

  3. For each document, search for a matching value (agent_name) in a Google Sheets file and retrieve the corresponding IP address.

  4. Update the MongoDB documents by setting the agent_ip field with the retrieved IP address from Google Sheets.

Issue Description:

The MongoDB node is unable to update the documents as intended. Additionally, due to the number of rows (1051) being processed in Google Sheets, I ran into a “Google Sheets quota exceeded” error.

Details of My Workflow:

I am using the Split Batches node to send one item at a time from MongoDB to the Google Sheets node to avoid exceeding the quota.

The Google Sheets node retrieves rows based on the agent_name and returns the corresponding IP address.

After retrieving the data from Google Sheets, the MongoDB node is supposed to update the document by setting the agent_ip field, but the update is not happening.

My Setup:

I am using the following MongoDB node parameters:

Operation: Update

Collection: (the relevant collection)

Update Key: (the document key)

Fields: agent_ip (to be updated with the value from Google Sheets)

Current Errors Encountered:

  1. MongoDB Update Issue: The update operation does not update the document as expected.

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:
1 Like