insert-many
Inserts multiple documents into a MongoDB collection in one call, batching large arrays to respect payload size limits.
Instructions
Insert an array of documents into a MongoDB collection. If the list of documents is above com.mongodb/maxRequestPayloadBytes, consider inserting them in batches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | Yes | Database name | |
| documents | Yes | The array of documents to insert, matching the syntax of the document argument of db.collection.insertMany(). | |
| collection | Yes | Collection name |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | Yes | ||
| collection | Yes | ||
| insertedIds | Yes | ||
| insertedCount | Yes |