On this page本页内容
Tip
Starting in version 3.2, MongoDB also provides the 从3.2版开始,MongoDB还提供了db.collection.bulkWrite()
method for performing bulk write operations.db.collection.bulkWrite()
方法来执行批量写入操作。
Bulk.
find
(<query>)¶Specifies a query condition for an update or a remove operation.指定更新或删除操作的查询条件。
Bulk.find()
accepts the following parameter:接受以下参数:
query |
document |
|
Use 将Bulk.find()
with the following write operations:Bulk.find()
用于以下写入操作:
The following example initializes a 下面的示例初始化Bulk()
operations builder for the items
collection and adds a remove operation and an update operation to the list of operations. items
集合的Bulk()
操作生成器,并将删除操作和更新操作添加到操作列表中。The remove operation and the update operation use the 删除操作和更新操作使用Bulk.find()
method to specify a condition for their respective actions:Bulk.find()
方法为各自的操作指定条件: