Members
Gets the name of the collection.
Methods
- pipeline
- Type:
[object, ...]
An array of aggregation pipeline stages.
- filter optional
- Type:
object
An optional filter applied to narrow down the results.
- options optional
- Type:
object
Additional options to apply.
- limit optional
- Type:
number
The maximum number of documents to return.
- filter
- Type:
object
A filter applied to narrow down the result.
- filter
- Type:
object
A filter applied to narrow down the result.
- filter optional
- Type:
object
An optional filter applied to narrow down the results.
- options optional
- Type:
object
Additional options to apply.
- projection optional
- Type:
object
Limits the fields to return for all matching documents. See Tutorial: Project Fields to Return from Query.
- sort optional
- Type:
object
The order in which to return matching documents.
- limit optional
- Type:
number
The maximum number of documents to return.
- filter optional
- Type:
object
An optional filter applied to narrow down the results.
- options optional
- Type:
object
Additional options to apply.
- projection optional
- Type:
object
Limits the fields to return for all matching documents. See Tutorial: Project Fields to Return from Query.
- sort optional
- Type:
object
The order in which to return matching documents.
- filter
- Type:
object
A filter applied to narrow down the results.
- options optional
- Type:
object
Additional options to apply.
- projection optional
- Type:
object
Limits the fields to return for all matching documents. See Tutorial: Project Fields to Return from Query.
- sort optional
- Type:
object
The order in which to return matching documents.
- filter
- Type:
object
A filter applied to narrow down the results.
- replacement
- Type:
object
The new values for the document.
- options optional
- Type:
object
Additional options to apply.
- projection optional
- Type:
object
Limits the fields to return for all matching documents. See Tutorial: Project Fields to Return from Query.
- sort optional
- Type:
object
The order in which to return matching documents.
- upsert optional
- Type:
boolean
- Default:
false
if true, indicates that MongoDB should insert a new document that matches the query filter when the query does not match any existing documents in the collection.
- returnNewDocument optional
- Type:
boolean
- Default:
false
if true, indicates that the action should return the document in its updated form instead of its original, pre-update form.
- filter
- Type:
object
A filter applied to narrow down the results.
- update
- Type:
object
The new values for the document.
- options optional
- Type:
object
Additional options to apply.
- projection optional
- Type:
object
Limits the fields to return for all matching documents. See Tutorial: Project Fields to Return from Query.
- sort optional
- Type:
object
The order in which to return matching documents.
- upsert optional
- Type:
boolean
- Default:
false
if true, indicates that MongoDB should insert a new document that matches the query filter when the query does not match any existing documents in the collection.
- returnNewDocument optional
- Type:
boolean
- Default:
false
if true, indicates that the action should return the document in its updated form instead of its original, pre-update form.
- documents
- Type:
[object, ...]
The array of documents.
- document
- Type:
object
The document.
- filter
- Type:
object
A filter applied to narrow down the results.
- update
- Type:
object
The new values for the document.
- options optional
- Type:
object
Additional options to apply.
- upsert optional
- Type:
boolean
- Default:
false
if true, indicates that MongoDB should insert a new document that matches the query filter when the query does not match any existing documents in the collection.
- arrayFilters optional
- Type:
[object, ...]
- Default:
false
if provided, indicates the arrayFilters to use to update an embedded array.
- filter
- Type:
object
A filter applied to narrow down the results.
- update
- Type:
object
The new values for the document.
- options optional
- Type:
object
Additional options to apply.
- upsert optional
- Type:
boolean
- Default:
false
if true, indicates that MongoDB should insert a new document that matches the query filter when the query does not match any existing documents in the collection.
- arrayFilters optional
- Type:
[object, ...]
- Default:
false
if provided, indicates the arrayFilters to use to update an embedded array.
- Polyfills for
fetch
,ReadableStream
andTextDecoder
: https://www.npmjs.com/package/react-native-polyfill-globals - Babel plugin enabling async generator syntax: https://npmjs.com/package/@babel/plugin-proposal-async-generator-functions
- options optional
- Type:
object
- Default:
{}
- filter optional
- Type:
object
A filter for which change events you are interested in.
- ids optional
- Type:
[any, ...]
A list of ids that you are interested in watching
Promise<[object>, ...]
Runs an aggregation framework pipeline against this collection.
Parameters:
Promise<[object>, ...]
The result.
Promise<number>
Counts the number of documents in this collection matching the provided filter.
Parameters:
Promise<number>
Promise<DeleteResult>
Deletes multiple documents.
Parameters:
Promise<DeleteResult>
Promise<DeleteResult>
Deletes a single matching document from the collection.
Parameters:
Promise<DeleteResult>
Promise<[object>, ...]
Finds the documents which match the provided query.
Parameters:
Promise<[object>, ...]
The documents.
Promise<object>
Finds a document which matches the provided filter.
Parameters:
Promise<object>
The document or null if nothing matched.
Promise<object>
Finds a document which matches the provided filter and deletes it
Parameters:
Promise<object>
The document or null if nothing matched.
Promise<?object>
Finds a document which matches the provided filter and replaces it with a new document.
Parameters:
Promise<?object>
The document (before or after modification) or null if nothing matched.
Promise<?object>
Finds a document which matches the provided query and performs the desired update to individual fields.
Parameters:
Promise<?object>
The document (before or after modification) or null if nothing matched.
Promise<InsertManyResult>
Inserts an array of documents into the collection. If any values are missing identifiers, they will be generated by the server.
Parameters:
Promise<InsertManyResult>
The _ids of the inserted documents.
Promise<InsertOneResult>
Inserts a single document into the collection. Note: If the document is missing an _id, one will be generated for it by the server.
Parameters:
Promise<InsertOneResult>
The _id of the inserted document.
Promise<UpdateResult>
Updates multiple documents matching the provided filter in this collection.
Parameters:
Promise<UpdateResult>
Promise<UpdateResult>
Updates a single document matching the provided filter in this collection.
Parameters:
Promise<UpdateResult>
ChangeEvent
Creates an asynchronous change stream to monitor this collection for changes.
By default, yields all change events for this collection. You may specify at most one of
the filter
or ids
options.
Important Note: To use this on React Native, you must install:
Parameters:
Type Definitions
- _id
The opaque resume token for this event.
- operationType
- Type:
string
What kind of operation was this? One of:
"insert"
,"delete"
,"replace"
,"update"
,"drop"
,"rename"
,"dropDatabase"
, or"invalidate"
.- fullDocument
- Type:
object
A full copy of the document that was touched by this operation. See the mongodb reference manual for details about which version of the document will be returned.
- ns
- Type:
object
Namespace of the collection affected by this event.
- db
- Type:
string
Database name
- coll
- Type:
string
Collection name
- to
- Type:
object
Destination namespace for
"rename"
events.- db
- Type:
string
Database name
- coll
- Type:
string
Collection name
- documentKey
- Type:
object
The
_id
and shard key of the modified document._id
is not duplicated if it is part of the shard key.- updateDescription
- Type:
object
- updatedFields
- Type:
object
An object mapping from modified field names to their new values.
- removedFields
- Type:
[string, ...]
A list of field names that were removed.
- clusterTime
- Type:
Timestamp
The timestamp from the oplog entry associated with the event.
- txnNumber
- Type:
Long
The transaction number. Only present if part of a multi-document transaction.
- lsid
- Type:
object
The logical session id of the transaction. Only present if part of a multi-document transaction.
- deletedCount
- Type:
number
The number of documents that were deleted.
- insertedIds
- Type:
Array
The ids of the inserted documents
- insertedId
The id of the inserted document
- matchedCount
- Type:
number
The number of documents that matched the filter.
- modifedCount
- Type:
number
The number of documents matched by the query.
- upsertedId optional
The identifier of the inserted document if an upsert took place.
An event in a change stream.
Note that which properties are present will depend on both the
operationType
field, which is itself always present, and the MongoDB
server version.
Type:
object
Properties:
Result of deleting documents
Type:
object
Properties:
Properties:
Properties:
Result of updating documents
Type:
object