MongoCollection

  • Opens a MongoDB change stream against the collection to watch for changes. The resulting stream will be notified of all events on this collection that the active user is authorized to see based on the configured MongoDB rules.

  • Opens a MongoDB change stream against the collection to watch for changes. The provided BSON document will be used as a match expression filter on the change events coming from the stream.

    See https://docs.mongodb.com/manual/reference/operator/aggregation/match/ for documentation around how to define a match filter.

    Defining the match expression to filter ChangeEvents is similar to defining the match expression for triggers: https://docs.mongodb.com/realm/triggers/database-triggers/

  • Opens a MongoDB change stream against the collection to watch for changes made to specific documents. The documents to watch must be explicitly specified by their _id.

  • Encodes the provided value to BSON and inserts it. If the value is missing an identifier, one will be generated for it.

  • Encodes the provided values to BSON and inserts them. If any values are missing identifiers, they will be generated.

  • Finds the documents in this collection which match the provided filter.

  • Returns one document from a collection or view which matches the provided filter. If multiple documents satisfy the query, this method returns the first document according to the query’s sort order or natural order.

  • Runs an aggregation framework pipeline against this collection.

  • Counts the number of documents in this collection matching the provided filter.

  • Deletes a single matching document from the collection.

  • Deletes multiple documents

  • Updates a single document matching the provided filter in this collection.

  • Updates multiple documents matching the provided filter in this collection.

  • Updates a single document in a collection based on a query filter and returns the document in either its pre-update or post-update form. Unlike updateOneDocument, this action allows you to atomically find, update, and return a document with the same command. This avoids the risk of other update operations changing the document between separate find and update operations.

  • Overwrites a single document in a collection based on a query filter and returns the document in either its pre-replacement or post-replacement form. Unlike updateOneDocument, this action allows you to atomically find, replace, and return a document with the same command. This avoids the risk of other update operations changing the document between separate find and update operations.

  • Removes a single document from a collection based on a query filter and returns a document with the same form as the document immediately before it was deleted. Unlike deleteOneDocument, this action allows you to atomically find and delete a document with the same command. This avoids the risk of other update operations changing the document between separate find and delete operations.