vibe.d beta banner
get vibe.d

Asynchronous I/O that doesn’t get in your way, written in D

Function MongoCollection.insert

Inserts new documents into the collection.

void insert(T) (
  T document_or_documents,
  InsertFlags flags = InsertFlags.None

Note that if the _id field of the document(s) is not set, typically using BsonObjectID.generate(), the server will generate IDs automatically. If you need to know the IDs of the inserted documents, you need to generate them locally.


Exception if a DB communication error occurred.

See Also


Sönke Ludwig


© 2012-2016 Sönke Ludwig


Subject to the terms of the MIT license, as written in the included LICENSE.txt file.