Insert Methods

MongoDB 提供了以下用于将documents插入到集合中的方法:

db.collection.insertOne()将单个文档插入集合中。
db.collection.insertMany()db.collection.insertMany()将* multiple * documents插入集合中。
db.collection.insert()db.collection.insert()将一个或多个文档插入到集合中。

插入的其他方法

以下方法还可以将新文档添加到集合中:

有关更多方法和示例,请参见各个方法的参考页。