Database Manual / Reference / mongosh Methods

Bulk Operation Methods批量操作方法

Note

For details on a specific method, including syntax and examples, click on the link to the method's reference page.有关特定方法的详细信息,包括语法和示例,请单击该方法参考页面的链接。

Tip

MongoDB also provides the Mongo.bulkWrite() method for performing bulk write operations.MongoDB还提供了Mongo.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()操作生成器。
Mongo.bulkWrite()Executes bulk write operations on multiple namespaces.对多个命名空间执行批量写入操作。
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.delete()Adds a multiple document delete operation to a list of operations.将多文档删除操作添加到操作列表中。
Bulk.find.deleteOne()Adds a single document delete operation to a list of operations.将单个文档删除操作添加到操作列表中。
Bulk.find.hint()Specifies the index to use for the update/replace operation.指定用于更新/替换操作的索引。
Bulk.find.remove()An alias for Bulk.find.delete().Bulk.find.delete()的别名。
Bulk.find.removeOne()An alias for Bulk.find.deleteOne().Bulk.find.deleteOne()的别名。
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()结果。