Bulk Operation Methods

Note注意

For details on specific methods, including syntax and examples, click on the specific method to go to its reference page.有关特定方法的详细信息,包括语法和示例,请单击特定方法以转到其参考页面。

Tip提示

Starting in version 3.2, MongoDB also provides the db.collection.bulkWrite() method for performing bulk write operations.从3.2版开始,MongoDB还提供了db.collection.bulkWrite()方法来执行批量写入操作。

Name名称Description描述
db.collection.initializeOrderedBulkOp()Initializes a Bulk() operations builder for an ordered list of operations.为操作的有序列表初始化Bulk()操作生成器。
db.collection.initializeUnorderedBulkOp()Initializes a Bulk() operations builder for an unordered list of operations.为无序操作列表初始化Bulk()操作生成器。
Bulk()Bulk operations builder.批量操作生成器。
Bulk.execute()Executes a list of operations in bulk.批量执行操作列表。
Bulk.find()Specifies the query condition for an update or a remove operation.指定更新或删除操作的查询条件。
Bulk.find.arrayFilters()Specifies the filters that determine which elements of an array to update for an update or updateOne operation.指定筛选器,用于确定要为updateupdateOne操作更新的数组元素。
Bulk.find.collation()Specifies the collation for the query condition.指定查询条件的排序规则
Bulk.find.hint()Specifies the index to use for the update/replace operation.指定用于更新/替换操作的索引。
Bulk.find.remove()Adds a multiple document remove operation to a list of operations.将多文档删除操作添加到操作列表中。
Bulk.find.removeOne()Adds a single document remove operation to a list of operations.将单个文档删除操作添加到操作列表中。
Bulk.find.replaceOne()Adds a single document replacement operation to a list of operations.将单个文档替换操作添加到操作列表中。
Bulk.find.updateOne()Adds a single document update operation to a list of operations.将单个文档更新操作添加到操作列表中。
Bulk.find.update()Adds a multi update operation to a list of operations.multi更新操作添加到操作列表中。
Bulk.find.upsert()Specifies upsert: true for an update operation.为更新操作指定upsert:true
Bulk.getOperations()Returns an array of write operations executed in the Bulk() operations object.返回在Bulk()操作对象中执行的写操作数组。
Bulk.insert()Adds an insert operation to a list of operations.将插入操作添加到操作列表中。
Bulk.tojson()Returns a JSON document that contains the number of operations and batches in the Bulk() operations object.返回一个JSON文档,其中包含Bulk()操作对象中的操作数和批处理数。
Bulk.toString()Returns the Bulk.tojson() results as a string.以字符串形式返回Bulk.tojson()结果。
←  PlanCache.list()db.collection.initializeOrderedBulkOp() →