Class: FindOperators

FindOperators

A builder object that is returned from BulkOperationBase#find.
Is used to build a write operation that involves a query filter.

new FindOperators(bulkOperation)

Creates a new FindOperators object.

NOTE: Internal Type, do not instantiate directly

Name Type Description
bulkOperation OrderedBulkOperation | UnorderedBulkOperation

Methods

Add a delete many operation to the bulk operation

Throws:

If operation cannot be added to bulk write

Type
MongoError
Returns:
reference to the parent BulkOperation

Add a delete one operation to the bulk operation

Throws:

If operation cannot be added to bulk write

Type
MongoError
Returns:
reference to the parent BulkOperation

backwards compatability for delete

Deprecated
  • Yes

backwards compatability for deleteOne

Deprecated
  • Yes

Add a replace one operation to the bulk operation

Name Type Description
replacement object

the new document to replace the existing one with

Throws:

If operation cannot be added to bulk write

Type
MongoError
Returns:
reference to the parent BulkOperation

Add a multiple update operation to the bulk operation

Name Type Description
updateDocument object

An update field for an update operation. See u documentation

options.hint object optional

An optional hint for query optimization. See the update command reference for more information.

Throws:

If operation cannot be added to bulk write

Type
MongoError
Returns:
reference to the parent BulkOperation

Add a single update operation to the bulk operation

Name Type Description
updateDocument object

An update field for an update operation. See u documentation

options.hint object optional

An optional hint for query optimization. See the update command reference for more information.

Throws:

If operation cannot be added to bulk write

Type
MongoError
Returns:
reference to the parent BulkOperation

Upsert modifier for update bulk operation, noting that this operation is an upsert.

Throws:

If operation cannot be added to bulk write

Type
MongoError
Returns:
to self