Mongo.insert_many
You're seeing just the function
insert_many
, go back to Mongo module for more information.
Specs
insert_many(GenServer.server(), collection(), [BSON.document()], Keyword.t()) :: result(Mongo.InsertManyResult.t())
Insert multiple documents into the collection.
If any of the documents is missing the _id
field or it is nil
, an ObjectId will be generated, and insertd into the document.
Ids of all documents will be returned in the result struct.
Options
For more information about options see Options
Examples
Mongo.insert_many(pid, "users", [%{first_name: "John", last_name: "Smith"}, %{first_name: "Jane", last_name: "Doe"}])