- 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:
-
Search MongoDB for documents that meet specific criteria (i.e., non-empty documents).
-
Retrieve these documents from MongoDB.
-
For each document, search for a matching value (agent_name) in a Google Sheets file and retrieve the corresponding IP address.
-
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:
- MongoDB Update Issue: The update operation does not update the document as expected.