Insert Methods插入方法

MongoDB provides the following methods for inserting documents into a collection:MongoDB提供了以下将文档插入集合的方法:

db.collection.insertOne() Inserts a single document into a collection.将单个文档插入到集合中。
db.collection.insertMany() db.collection.insertMany() inserts multiple documents into a collection.将多个文档插入到集合中。
db.collection.insert() db.collection.insert() inserts a single document or multiple documents into a collection.将单个文档或多个文档插入到集合中。

Additional Methods for Inserts插入的其他方法

The following methods can also add new documents to a collection:以下方法还可以向集合添加新文档:

See the individual reference pages for the methods for more information and examples.有关更多信息和示例,请参阅各个参考页中的方法。