Mongo.Repo.insert_all
You're seeing just the callback
insert_all
, go back to Mongo.Repo module for more information.
Specs
insert_all( module :: module(), entries :: [BSON.document()], opts :: Keyword.t() ) :: {:ok, integer(), [BSON.ObjectId.t()]} | {:error, any()}
Inserts all given documents into the document in one write operation and returns an :ok
tuple
with the count of inserted documents as second element and the inserted ids as third element.
Returns {:error, reason}
on failure.
Example
MyApp.Repo.insert_all(Post, [%{title: "a"}, %{title: "b"}])