Bulk Write
AI-generatedSummary
Executes a bulk write operation on a MongoDB collection defined by the provided operations.
Inputs
- collection (required) — MongoDB Collection Name
- operations (required) — Array of bulk write operations
- dateFields — Comma-separated list of field names that should be converted to Date objects for insert/update operations (e.g., timestamp,createdAt,updatedAt)
- options — Bulk write options including ordered execution and conversion of _id to ObjectId
Output shape
array of objects representing the result of each executed bulk operation
Each result contains the raw MongoDB bulkWrite response; errors are propagated as normal n8n errors; the shape may include acknowledged, insertedCount, etc., depending on the operation.
Examples
Example 1: Insert a document with automatic Date field conversion
collection: users; operations: [{"insertOne": {"document": {"name": "John", "createdAt": "2024-01-01"}}]; dateFields: "createdAt"; options: {"ordered": true, "convertIdToObjectId": true}
