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
-
-
deleteOne(){OrderedBulkOperation|UnorderedBulkOperation}
-
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
-
-
remove()
-
backwards compatability for delete
- Deprecated
- Yes
-
removeOne()
-
backwards compatability for deleteOne
- Deprecated
- Yes
-
replaceOne(replacement){OrderedBulkOperation|UnorderedBulkOperation}
-
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
-
-
update(updateDocument){OrderedBulkOperation|UnorderedBulkOperation}
-
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
-
-
updateOne(updateDocument){OrderedBulkOperation|UnorderedBulkOperation}
-
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(){FindOperators}
-
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
-