Skip to main content
Very Popular
Latest
method Collection.prototype.insertMany
import { Collection } from "https://deno.land/x/mongo@v0.33.0/src/collection/mod.ts";

Insert multiple documents into the collection

Parameters

docs: InsertDocument<T>[]

An array of documents to insert

optional
options: InsertOptions

Additional options for the operation

Returns

Promise<{ insertedIds: Required<InsertDocument<T>>["_id"][]; insertedCount: number; }>

The inserted documents' IDs and the number of documents inserted