On this page本页内容
Tip
Starting in version 3.2, MongoDB also provides the db.collection.bulkWrite()
method for performing bulk write operations.
Bulk.find.
hint
()¶New in version 4.2.1.
Sets the hint
option that specifies the index to support the Bulk.find()
for:
The option can take an index specification document or the index name string.
If you specify an index that does not exist, the operation errors.
Bulk.find.hint()
has no effect on Bulk.find.removeOne()
Create an example collection orders
:
Create the following indexes on the example collection:
The following bulk operations specify different index to use for the various update/replace document operations:
To view the indexes used, you can use the $indexStats
pipeline: