vibe.d beta banner
get vibe.d
0.7.30

Function MongoCollection.insert

Inserts new documents into the collection.

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.

Prototype

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

Throws

Exception if a DB communication error occured.

See Also

http://www.mongodb.org/display/DOCS/Inserting

Authors

Sönke Ludwig

Copyright

© 2012-2016 RejectedSoftware e.K.

License

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