case class MongoCollection[TResult](wrapped: com.mongodb.reactivestreams.client.MongoCollection[TResult]) extends Product with Serializable
The MongoCollection representation.
- TResult
The type that this collection will encode documents from and decode documents to.
- wrapped
the underlying java MongoCollection
- Since
1.0
- Alphabetic
- By Inheritance
- MongoCollection
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new MongoCollection(wrapped: com.mongodb.reactivestreams.client.MongoCollection[TResult])
- wrapped
the underlying java MongoCollection
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def aggregate[C](clientSession: ClientSession, pipeline: Seq[Bson])(implicit e: DefaultsTo[C, TResult], ct: ClassTag[C]): AggregateObservable[C]
Aggregates documents according to the specified aggregation pipeline.
Aggregates documents according to the specified aggregation pipeline.
- clientSession
the client session with which to associate this operation
- pipeline
the aggregate pipeline
- returns
a Observable containing the result of the aggregation operation Aggregation
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def aggregate[C](pipeline: Seq[Bson])(implicit e: DefaultsTo[C, TResult], ct: ClassTag[C]): AggregateObservable[C]
Aggregates documents according to the specified aggregation pipeline.
Aggregates documents according to the specified aggregation pipeline.
- pipeline
the aggregate pipeline
- returns
a Observable containing the result of the aggregation operation Aggregation
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def bulkWrite(clientSession: ClientSession, requests: Seq[_ <: WriteModel[_ <: TResult]], options: BulkWriteOptions): SingleObservable[BulkWriteResult]
Executes a mix of inserts, updates, replaces, and deletes.
Executes a mix of inserts, updates, replaces, and deletes.
- clientSession
the client session with which to associate this operation
- requests
the writes to execute
- options
the options to apply to the bulk write operation
- returns
a Observable with a single element the BulkWriteResult
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def bulkWrite(clientSession: ClientSession, requests: Seq[_ <: WriteModel[_ <: TResult]]): SingleObservable[BulkWriteResult]
Executes a mix of inserts, updates, replaces, and deletes.
Executes a mix of inserts, updates, replaces, and deletes.
- clientSession
the client session with which to associate this operation
- requests
the writes to execute
- returns
a Observable with a single element the BulkWriteResult
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def bulkWrite(requests: Seq[_ <: WriteModel[_ <: TResult]], options: BulkWriteOptions): SingleObservable[BulkWriteResult]
Executes a mix of inserts, updates, replaces, and deletes.
Executes a mix of inserts, updates, replaces, and deletes.
- requests
the writes to execute
- options
the options to apply to the bulk write operation
- returns
a Observable with a single element the BulkWriteResult
- def bulkWrite(requests: Seq[_ <: WriteModel[_ <: TResult]]): SingleObservable[BulkWriteResult]
Executes a mix of inserts, updates, replaces, and deletes.
Executes a mix of inserts, updates, replaces, and deletes.
- requests
the writes to execute
- returns
a Observable with a single element the BulkWriteResult
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- lazy val codecRegistry: CodecRegistry
Get the codec registry for the MongoDatabase.
Get the codec registry for the MongoDatabase.
- returns
the { @link org.bson.codecs.configuration.CodecRegistry}
- def countDocuments(clientSession: ClientSession, filter: Bson, options: CountOptions): SingleObservable[Long]
Counts the number of documents in the collection according to the given options.
Counts the number of documents in the collection according to the given options.
Note: For a fast count of the total documents in a collection see estimatedDocumentCount() When migrating from
count()
tocountDocuments()
the following query operators must be replaced:+-------------+--------------------------------+ | Operator | Replacement | +=============+================================+ | $where | $expr | +-------------+--------------------------------+ | $near | $geoWithin with $center | +-------------+--------------------------------+ | $nearSphere | $geoWithin with $centerSphere | +-------------+--------------------------------+
- clientSession
the client session with which to associate this operation
- filter
the query filter
- options
the options describing the count
- returns
a publisher with a single element indicating the number of documents
- Since
2.4
- Note
Requires MongoDB 3.6 or greater
- def countDocuments(clientSession: ClientSession, filter: Bson): SingleObservable[Long]
Counts the number of documents in the collection according to the given options.
Counts the number of documents in the collection according to the given options.
Note: For a fast count of the total documents in a collection see estimatedDocumentCount() When migrating from
count()
tocountDocuments()
the following query operators must be replaced:+-------------+--------------------------------+ | Operator | Replacement | +=============+================================+ | $where | $expr | +-------------+--------------------------------+ | $near | $geoWithin with $center | +-------------+--------------------------------+ | $nearSphere | $geoWithin with $centerSphere | +-------------+--------------------------------+
- clientSession
the client session with which to associate this operation
- filter
the query filter
- returns
a publisher with a single element indicating the number of documents
- Since
2.4
- Note
Requires MongoDB 3.6 or greater
- def countDocuments(clientSession: ClientSession): SingleObservable[Long]
Counts the number of documents in the collection.
Counts the number of documents in the collection.
Note: For a fast count of the total documents in a collection see estimatedDocumentCount() When migrating from
count()
tocountDocuments()
the following query operators must be replaced:+-------------+--------------------------------+ | Operator | Replacement | +=============+================================+ | $where | $expr | +-------------+--------------------------------+ | $near | $geoWithin with $center | +-------------+--------------------------------+ | $nearSphere | $geoWithin with $centerSphere | +-------------+--------------------------------+
- clientSession
the client session with which to associate this operation
- returns
a publisher with a single element indicating the number of documents
- Since
2.4
- Note
Requires MongoDB 3.6 or greater
- def countDocuments(filter: Bson, options: CountOptions): SingleObservable[Long]
Counts the number of documents in the collection according to the given options.
Counts the number of documents in the collection according to the given options.
Note: For a fast count of the total documents in a collection see estimatedDocumentCount() When migrating from
count()
tocountDocuments()
the following query operators must be replaced:+-------------+--------------------------------+ | Operator | Replacement | +=============+================================+ | $where | $expr | +-------------+--------------------------------+ | $near | $geoWithin with $center | +-------------+--------------------------------+ | $nearSphere | $geoWithin with $centerSphere | +-------------+--------------------------------+
- filter
the query filter
- options
the options describing the count
- returns
a publisher with a single element indicating the number of documents
- Since
2.4
- def countDocuments(filter: Bson): SingleObservable[Long]
Counts the number of documents in the collection according to the given options.
Counts the number of documents in the collection according to the given options.
Note: For a fast count of the total documents in a collection see estimatedDocumentCount() When migrating from
count()
tocountDocuments()
the following query operators must be replaced:+-------------+--------------------------------+ | Operator | Replacement | +=============+================================+ | $where | $expr | +-------------+--------------------------------+ | $near | $geoWithin with $center | +-------------+--------------------------------+ | $nearSphere | $geoWithin with $centerSphere | +-------------+--------------------------------+
- filter
the query filter
- returns
a publisher with a single element indicating the number of documents
- Since
2.4
- def countDocuments(): SingleObservable[Long]
Counts the number of documents in the collection.
Counts the number of documents in the collection.
Note: For a fast count of the total documents in a collection see estimatedDocumentCount() When migrating from
count()
tocountDocuments()
the following query operators must be replaced:+-------------+--------------------------------+ | Operator | Replacement | +=============+================================+ | $where | $expr | +-------------+--------------------------------+ | $near | $geoWithin with $center | +-------------+--------------------------------+ | $nearSphere | $geoWithin with $centerSphere | +-------------+--------------------------------+
- returns
a publisher with a single element indicating the number of documents
- Since
2.4
- def createIndex(clientSession: ClientSession, key: Bson, options: IndexOptions): SingleObservable[String]
- clientSession
the client session with which to associate this operation
- key
an object describing the index key(s), which may not be null. This can be of any type for which a
Codec
is registered- options
the options for the index
- returns
an empty Observable that indicates when the operation has completed
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def createIndex(clientSession: ClientSession, key: Bson): SingleObservable[String]
- clientSession
the client session with which to associate this operation
- key
an object describing the index key(s), which may not be null. This can be of any type for which a
Codec
is registered- returns
an empty Observable that indicates when the operation has completed
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def createIndex(key: Bson, options: IndexOptions): SingleObservable[String]
- key
an object describing the index key(s), which may not be null. This can be of any type for which a
Codec
is registered- options
the options for the index
- returns
an empty Observable that indicates when the operation has completed
- def createIndex(key: Bson): SingleObservable[String]
- key
an object describing the index key(s), which may not be null. This can be of any type for which a
Codec
is registered- returns
an empty Observable that indicates when the operation has completed
- def createIndexes(clientSession: ClientSession, models: Seq[IndexModel], createIndexOptions: CreateIndexOptions): Observable[String]
Create multiple indexes.
Create multiple indexes.
- clientSession
the client session with which to associate this operation
- models
the list of indexes to create
- createIndexOptions
options to use when creating indexes
- returns
a Observable with the names of the indexes
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def createIndexes(clientSession: ClientSession, models: Seq[IndexModel]): Observable[String]
Create multiple indexes.
Create multiple indexes.
- clientSession
the client session with which to associate this operation
- models
the list of indexes to create
- returns
a Observable with the names of the indexes
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def createIndexes(models: Seq[IndexModel], createIndexOptions: CreateIndexOptions): Observable[String]
Create multiple indexes.
Create multiple indexes.
- models
the list of indexes to create
- createIndexOptions
options to use when creating indexes
- returns
a Observable with the names of the indexes
- Since
2.2
- def createIndexes(models: Seq[IndexModel]): Observable[String]
Create multiple indexes.
Create multiple indexes.
- models
the list of indexes to create
- returns
a Observable with the names of the indexes
- def deleteMany(clientSession: ClientSession, filter: Bson, options: DeleteOptions): SingleObservable[DeleteResult]
Removes all documents from the collection that match the given query filter.
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.
- clientSession
the client session with which to associate this operation
- filter
the query filter to apply the the delete operation
- options
the options to apply to the delete operation
- returns
a Observable with a single element the DeleteResult or with an com.mongodb.MongoException
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def deleteMany(clientSession: ClientSession, filter: Bson): SingleObservable[DeleteResult]
Removes all documents from the collection that match the given query filter.
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.
- clientSession
the client session with which to associate this operation
- filter
the query filter to apply the the delete operation
- returns
a Observable with a single element the DeleteResult or with an com.mongodb.MongoException
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def deleteMany(filter: Bson, options: DeleteOptions): SingleObservable[DeleteResult]
Removes all documents from the collection that match the given query filter.
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.
- filter
the query filter to apply the the delete operation
- options
the options to apply to the delete operation
- returns
a Observable with a single element the DeleteResult or with an com.mongodb.MongoException
- Since
1.2
- def deleteMany(filter: Bson): SingleObservable[DeleteResult]
Removes all documents from the collection that match the given query filter.
Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.
- filter
the query filter to apply the the delete operation
- returns
a Observable with a single element the DeleteResult or with an com.mongodb.MongoException
- def deleteOne(clientSession: ClientSession, filter: Bson, options: DeleteOptions): SingleObservable[DeleteResult]
Removes at most one document from the collection that matches the given filter.
Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.
- clientSession
the client session with which to associate this operation
- filter
the query filter to apply the the delete operation
- options
the options to apply to the delete operation
- returns
a Observable with a single element the DeleteResult or with an com.mongodb.MongoException
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def deleteOne(clientSession: ClientSession, filter: Bson): SingleObservable[DeleteResult]
Removes at most one document from the collection that matches the given filter.
Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.
- clientSession
the client session with which to associate this operation
- filter
the query filter to apply the the delete operation
- returns
a Observable with a single element the DeleteResult or with an com.mongodb.MongoException
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def deleteOne(filter: Bson, options: DeleteOptions): SingleObservable[DeleteResult]
Removes at most one document from the collection that matches the given filter.
Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.
- filter
the query filter to apply the the delete operation
- options
the options to apply to the delete operation
- returns
a Observable with a single element the DeleteResult or with an com.mongodb.MongoException
- Since
1.2
- def deleteOne(filter: Bson): SingleObservable[DeleteResult]
Removes at most one document from the collection that matches the given filter.
Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.
- filter
the query filter to apply the the delete operation
- returns
a Observable with a single element the DeleteResult or with an com.mongodb.MongoException
- def distinct[C](clientSession: ClientSession, fieldName: String, filter: Bson)(implicit ct: ClassTag[C]): DistinctObservable[C]
Gets the distinct values of the specified field name.
Gets the distinct values of the specified field name.
- C
the target type of the observable.
- clientSession
the client session with which to associate this operation
- fieldName
the field name
- filter
the query filter
- returns
a Observable emitting the sequence of distinct values
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def distinct[C](clientSession: ClientSession, fieldName: String)(implicit ct: ClassTag[C]): DistinctObservable[C]
Gets the distinct values of the specified field name.
Gets the distinct values of the specified field name.
- C
the target type of the observable.
- clientSession
the client session with which to associate this operation
- fieldName
the field name
- returns
a Observable emitting the sequence of distinct values
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def distinct[C](fieldName: String, filter: Bson)(implicit ct: ClassTag[C]): DistinctObservable[C]
Gets the distinct values of the specified field name.
Gets the distinct values of the specified field name.
- C
the target type of the observable.
- fieldName
the field name
- filter
the query filter
- returns
a Observable emitting the sequence of distinct values
- def distinct[C](fieldName: String)(implicit ct: ClassTag[C]): DistinctObservable[C]
Gets the distinct values of the specified field name.
Gets the distinct values of the specified field name.
- C
the target type of the observable.
- fieldName
the field name
- returns
a Observable emitting the sequence of distinct values
- lazy val documentClass: Class[TResult]
Get the default class to cast any documents returned from the database into.
Get the default class to cast any documents returned from the database into.
- returns
the default class to cast any documents into
- def drop(clientSession: ClientSession): SingleObservable[Void]
Drops this collection from the Database.
Drops this collection from the Database.
- clientSession
the client session with which to associate this operation
- returns
an empty Observable that indicates when the operation has completed Drop Collection
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def drop(): SingleObservable[Void]
Drops this collection from the Database.
Drops this collection from the Database.
- returns
an empty Observable that indicates when the operation has completed Drop Collection
- def dropIndex(clientSession: ClientSession, keys: Bson, dropIndexOptions: DropIndexOptions): SingleObservable[Void]
Drops the index given the keys used to create it.
Drops the index given the keys used to create it.
- clientSession
the client session with which to associate this operation
- keys
the keys of the index to remove
- dropIndexOptions
options to use when dropping indexes
- returns
an empty Observable that indicates when the operation has completed
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def dropIndex(clientSession: ClientSession, keys: Bson): SingleObservable[Void]
Drops the index given the keys used to create it.
Drops the index given the keys used to create it.
- clientSession
the client session with which to associate this operation
- keys
the keys of the index to remove
- returns
an empty Observable that indicates when the operation has completed
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def dropIndex(clientSession: ClientSession, indexName: String, dropIndexOptions: DropIndexOptions): SingleObservable[Void]
Drops the given index.
Drops the given index.
- clientSession
the client session with which to associate this operation
- indexName
the name of the index to remove
- dropIndexOptions
options to use when dropping indexes
- returns
an empty Observable that indicates when the operation has completed
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def dropIndex(clientSession: ClientSession, indexName: String): SingleObservable[Void]
Drops the given index.
Drops the given index.
- clientSession
the client session with which to associate this operation
- indexName
the name of the index to remove
- returns
an empty Observable that indicates when the operation has completed
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def dropIndex(keys: Bson, dropIndexOptions: DropIndexOptions): SingleObservable[Void]
Drops the index given the keys used to create it.
Drops the index given the keys used to create it.
- keys
the keys of the index to remove
- dropIndexOptions
options to use when dropping indexes
- returns
an empty Observable that indicates when the operation has completed
- Since
2.2
- def dropIndex(keys: Bson): SingleObservable[Void]
Drops the index given the keys used to create it.
Drops the index given the keys used to create it.
- keys
the keys of the index to remove
- returns
an empty Observable that indicates when the operation has completed
- def dropIndex(indexName: String, dropIndexOptions: DropIndexOptions): SingleObservable[Void]
Drops the given index.
Drops the given index.
- indexName
the name of the index to remove
- dropIndexOptions
options to use when dropping indexes
- returns
an empty Observable that indicates when the operation has completed
- Since
2.2
- def dropIndex(indexName: String): SingleObservable[Void]
Drops the given index.
Drops the given index.
- indexName
the name of the index to remove
- returns
an empty Observable that indicates when the operation has completed
- def dropIndexes(clientSession: ClientSession, dropIndexOptions: DropIndexOptions): SingleObservable[Void]
Drop all the indexes on this collection, except for the default on _id.
Drop all the indexes on this collection, except for the default on _id.
- clientSession
the client session with which to associate this operation
- dropIndexOptions
options to use when dropping indexes
- returns
an empty Observable that indicates when the operation has completed
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def dropIndexes(clientSession: ClientSession): SingleObservable[Void]
Drop all the indexes on this collection, except for the default on _id.
Drop all the indexes on this collection, except for the default on _id.
- clientSession
the client session with which to associate this operation
- returns
an empty Observable that indicates when the operation has completed
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def dropIndexes(dropIndexOptions: DropIndexOptions): SingleObservable[Void]
Drop all the indexes on this collection, except for the default on _id.
Drop all the indexes on this collection, except for the default on _id.
- dropIndexOptions
options to use when dropping indexes
- returns
an empty Observable that indicates when the operation has completed
- Since
2.2
- def dropIndexes(): SingleObservable[Void]
Drop all the indexes on this collection, except for the default on _id.
Drop all the indexes on this collection, except for the default on _id.
- returns
an empty Observable that indicates when the operation has completed
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def estimatedDocumentCount(options: EstimatedDocumentCountOptions): SingleObservable[Long]
Gets an estimate of the count of documents in a collection using collection metadata.
Gets an estimate of the count of documents in a collection using collection metadata.
- options
the options describing the count
- returns
a publisher with a single element indicating the estimated number of documents
- Since
2.4
- def estimatedDocumentCount(): SingleObservable[Long]
Gets an estimate of the count of documents in a collection using collection metadata.
Gets an estimate of the count of documents in a collection using collection metadata.
- returns
a publisher with a single element indicating the estimated number of documents
- Since
2.4
- def find[C](clientSession: ClientSession, filter: Bson)(implicit e: DefaultsTo[C, TResult], ct: ClassTag[C]): FindObservable[C]
Finds all documents in the collection.
Finds all documents in the collection.
- C
the target document type of the observable.
- clientSession
the client session with which to associate this operation
- filter
the query filter
- returns
the find Observable
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def find[C](clientSession: ClientSession)(implicit e: DefaultsTo[C, TResult], ct: ClassTag[C]): FindObservable[C]
Finds all documents in the collection.
Finds all documents in the collection.
- C
the target document type of the observable.
- clientSession
the client session with which to associate this operation
- returns
the find Observable
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def find[C](filter: Bson)(implicit e: DefaultsTo[C, TResult], ct: ClassTag[C]): FindObservable[C]
Finds all documents in the collection.
Finds all documents in the collection.
- C
the target document type of the observable.
- filter
the query filter
- returns
the find Observable
- def find[C]()(implicit e: DefaultsTo[C, TResult], ct: ClassTag[C]): FindObservable[C]
Finds all documents in the collection.
Finds all documents in the collection.
- C
the target document type of the observable.
- returns
the find Observable
- def findOneAndDelete(clientSession: ClientSession, filter: Bson, options: FindOneAndDeleteOptions): SingleObservable[TResult]
Atomically find a document and remove it.
Atomically find a document and remove it.
- clientSession
the client session with which to associate this operation
- filter
the query filter to find the document with
- options
the options to apply to the operation
- returns
a Observable with a single element the document that was removed. If no documents matched the query filter, then null will be returned
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def findOneAndDelete(clientSession: ClientSession, filter: Bson): SingleObservable[TResult]
Atomically find a document and remove it.
Atomically find a document and remove it.
- clientSession
the client session with which to associate this operation
- filter
the query filter to find the document with
- returns
a Observable with a single element the document that was removed. If no documents matched the query filter, then null will be returned
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def findOneAndDelete(filter: Bson, options: FindOneAndDeleteOptions): SingleObservable[TResult]
Atomically find a document and remove it.
Atomically find a document and remove it.
- filter
the query filter to find the document with
- options
the options to apply to the operation
- returns
a Observable with a single element the document that was removed. If no documents matched the query filter, then null will be returned
- def findOneAndDelete(filter: Bson): SingleObservable[TResult]
Atomically find a document and remove it.
Atomically find a document and remove it.
- filter
the query filter to find the document with
- returns
a Observable with a single element the document that was removed. If no documents matched the query filter, then null will be returned
- def findOneAndReplace(clientSession: ClientSession, filter: Bson, replacement: TResult, options: FindOneAndReplaceOptions): SingleObservable[TResult]
Atomically find a document and replace it.
Atomically find a document and replace it.
- clientSession
the client session with which to associate this operation
- filter
the query filter to apply the the replace operation
- replacement
the replacement document
- options
the options to apply to the operation
- returns
a Observable with a single element the document that was replaced. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def findOneAndReplace(clientSession: ClientSession, filter: Bson, replacement: TResult): SingleObservable[TResult]
Atomically find a document and replace it.
Atomically find a document and replace it.
- clientSession
the client session with which to associate this operation
- filter
the query filter to apply the the replace operation
- replacement
the replacement document
- returns
a Observable with a single element the document that was replaced. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def findOneAndReplace(filter: Bson, replacement: TResult, options: FindOneAndReplaceOptions): SingleObservable[TResult]
Atomically find a document and replace it.
Atomically find a document and replace it.
- filter
the query filter to apply the the replace operation
- replacement
the replacement document
- options
the options to apply to the operation
- returns
a Observable with a single element the document that was replaced. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
- def findOneAndReplace(filter: Bson, replacement: TResult): SingleObservable[TResult]
Atomically find a document and replace it.
Atomically find a document and replace it.
- filter
the query filter to apply the the replace operation
- replacement
the replacement document
- returns
a Observable with a single element the document that was replaced. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
- def findOneAndUpdate(clientSession: ClientSession, filter: Bson, update: Seq[Bson], options: FindOneAndUpdateOptions): SingleObservable[TResult]
Atomically find a document and update it.
Atomically find a document and update it.
- clientSession
the client session with which to associate this operation
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a pipeline describing the update.
- options
the options to apply to the operation
- returns
a Observable with a single element the document that was updated. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
- Since
2.7
- Note
Requires MongoDB 4.2 or greater
- def findOneAndUpdate(clientSession: ClientSession, filter: Bson, update: Seq[Bson]): SingleObservable[TResult]
Atomically find a document and update it.
Atomically find a document and update it.
- clientSession
the client session with which to associate this operation
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a pipeline describing the update.
- returns
a Observable with a single element the document that was updated. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
- Since
2.7
- Note
Requires MongoDB 4.2 or greater
- def findOneAndUpdate(filter: Bson, update: Seq[Bson], options: FindOneAndUpdateOptions): SingleObservable[TResult]
Atomically find a document and update it.
Atomically find a document and update it.
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a pipeline describing the update.
- options
the options to apply to the operation
- returns
a Observable with a single element the document that was updated. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
- Since
2.7
- Note
Requires MongoDB 4.2 or greater
- def findOneAndUpdate(filter: Bson, update: Seq[Bson]): SingleObservable[TResult]
Atomically find a document and update it.
Atomically find a document and update it.
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a pipeline describing the update.
- returns
a Observable with a single element the document that was updated. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
- Since
2.7
- Note
Requires MongoDB 4.2 or greater
- def findOneAndUpdate(clientSession: ClientSession, filter: Bson, update: Bson, options: FindOneAndUpdateOptions): SingleObservable[TResult]
Atomically find a document and update it.
Atomically find a document and update it.
- clientSession
the client session with which to associate this operation
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a document describing the update, which may not be null. The update to apply must include only update operators. This can be of any type for which a
Codec
is registered- options
the options to apply to the operation
- returns
a Observable with a single element the document that was updated. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def findOneAndUpdate(clientSession: ClientSession, filter: Bson, update: Bson): SingleObservable[TResult]
Atomically find a document and update it.
Atomically find a document and update it.
- clientSession
the client session with which to associate this operation
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a document describing the update, which may not be null. The update to apply must include only update operators. This can be of any type for which a
Codec
is registered- returns
a Observable with a single element the document that was updated. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def findOneAndUpdate(filter: Bson, update: Bson, options: FindOneAndUpdateOptions): SingleObservable[TResult]
Atomically find a document and update it.
Atomically find a document and update it.
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a document describing the update, which may not be null. The update to apply must include only update operators. This can be of any type for which a
Codec
is registered- options
the options to apply to the operation
- returns
a Observable with a single element the document that was updated. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
- def findOneAndUpdate(filter: Bson, update: Bson): SingleObservable[TResult]
Atomically find a document and update it.
Atomically find a document and update it.
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a document describing the update, which may not be null. The update to apply must include only update operators. This can be of any type for which a
Codec
is registered- returns
a Observable with a single element the document that was updated. Depending on the value of the
returnOriginal
property, this will either be the document as it was before the update or as it is after the update. If no documents matched the query filter, then null will be returned
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def insertMany(clientSession: ClientSession, documents: Seq[_ <: TResult], options: InsertManyOptions): SingleObservable[InsertManyResult]
Inserts a batch of documents.
Inserts a batch of documents. The preferred way to perform bulk inserts is to use the BulkWrite API.
- clientSession
the client session with which to associate this operation
- documents
the documents to insert
- options
the options to apply to the operation
- returns
a Observable with a single element the InsertManyResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoExceptionn
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def insertMany(clientSession: ClientSession, documents: Seq[_ <: TResult]): SingleObservable[InsertManyResult]
Inserts a batch of documents.
Inserts a batch of documents. The preferred way to perform bulk inserts is to use the BulkWrite API.
- clientSession
the client session with which to associate this operation
- documents
the documents to insert
- returns
a Observable with a single element the InsertManyResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def insertMany(documents: Seq[_ <: TResult], options: InsertManyOptions): SingleObservable[InsertManyResult]
Inserts a batch of documents.
Inserts a batch of documents. The preferred way to perform bulk inserts is to use the BulkWrite API. However, when talking with a server < 2.6, using this method will be faster due to constraints in the bulk API related to error handling.
- documents
the documents to insert
- options
the options to apply to the operation
- returns
a Observable with a single element the InsertManyResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
- def insertMany(documents: Seq[_ <: TResult]): SingleObservable[InsertManyResult]
Inserts a batch of documents.
Inserts a batch of documents. The preferred way to perform bulk inserts is to use the BulkWrite API. However, when talking with a server < 2.6, using this method will be faster due to constraints in the bulk API related to error handling.
- documents
the documents to insert
- returns
a Observable with a single element the InsertManyResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
- def insertOne(clientSession: ClientSession, document: TResult, options: InsertOneOptions): SingleObservable[InsertOneResult]
Inserts the provided document.
Inserts the provided document. If the document is missing an identifier, the driver should generate one.
- clientSession
the client session with which to associate this operation
- document
the document to insert
- options
the options to apply to the operation
- returns
a Observable with a single element the InsertOneResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def insertOne(clientSession: ClientSession, document: TResult): SingleObservable[InsertOneResult]
Inserts the provided document.
Inserts the provided document. If the document is missing an identifier, the driver should generate one.
- clientSession
the client session with which to associate this operation
- document
the document to insert
- returns
a Observable with a single element the InsertOneResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def insertOne(document: TResult, options: InsertOneOptions): SingleObservable[InsertOneResult]
Inserts the provided document.
Inserts the provided document. If the document is missing an identifier, the driver should generate one.
- document
the document to insert
- options
the options to apply to the operation
- returns
a Observable with a single element the InsertOneResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
- Since
1.1
- def insertOne(document: TResult): SingleObservable[InsertOneResult]
Inserts the provided document.
Inserts the provided document. If the document is missing an identifier, the driver should generate one.
- document
the document to insert
- returns
a Observable with a single element the InsertOneResult or with either a com.mongodb.DuplicateKeyException or com.mongodb.MongoException
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def listIndexes[C](clientSession: ClientSession)(implicit e: DefaultsTo[C, Document], ct: ClassTag[C]): ListIndexesObservable[C]
Get all the indexes in this collection.
Get all the indexes in this collection.
- C
the target document type of the observable.
- clientSession
the client session with which to associate this operation
- returns
the fluent list indexes interface
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def listIndexes[C]()(implicit e: DefaultsTo[C, Document], ct: ClassTag[C]): ListIndexesObservable[C]
Get all the indexes in this collection.
Get all the indexes in this collection.
- C
the target document type of the observable.
- returns
the fluent list indexes interface
- def mapReduce[C](clientSession: ClientSession, mapFunction: String, reduceFunction: String)(implicit e: DefaultsTo[C, TResult], ct: ClassTag[C]): MapReduceObservable[C]
Aggregates documents according to the specified map-reduce function.
Aggregates documents according to the specified map-reduce function.
- C
the target document type of the observable.
- clientSession
the client session with which to associate this operation
- mapFunction
A JavaScript function that associates or "maps" a value with a key and emits the key and value pair.
- reduceFunction
A JavaScript function that "reduces" to a single object all the values associated with a particular key.
- returns
a Observable containing the result of the map-reduce operation map-reduce
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def mapReduce[C](mapFunction: String, reduceFunction: String)(implicit e: DefaultsTo[C, TResult], ct: ClassTag[C]): MapReduceObservable[C]
Aggregates documents according to the specified map-reduce function.
Aggregates documents according to the specified map-reduce function.
- C
the target document type of the observable.
- mapFunction
A JavaScript function that associates or "maps" a value with a key and emits the key and value pair.
- reduceFunction
A JavaScript function that "reduces" to a single object all the values associated with a particular key.
- returns
a Observable containing the result of the map-reduce operation map-reduce
- lazy val namespace: MongoNamespace
Gets the namespace of this collection.
Gets the namespace of this collection.
- returns
the namespace
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- lazy val readConcern: ReadConcern
Get the read concern for the MongoDatabase.
- lazy val readPreference: ReadPreference
Get the read preference for the MongoDatabase.
Get the read preference for the MongoDatabase.
- returns
the { @link com.mongodb.ReadPreference}
- def renameCollection(clientSession: ClientSession, newCollectionNamespace: MongoNamespace, options: RenameCollectionOptions): SingleObservable[Void]
Rename the collection with oldCollectionName to the newCollectionName.
Rename the collection with oldCollectionName to the newCollectionName.
- clientSession
the client session with which to associate this operation
- newCollectionNamespace
the name the collection will be renamed to
- options
the options for renaming a collection
- returns
an empty Observable that indicates when the operation has completed
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def renameCollection(clientSession: ClientSession, newCollectionNamespace: MongoNamespace): SingleObservable[Void]
Rename the collection with oldCollectionName to the newCollectionName.
Rename the collection with oldCollectionName to the newCollectionName.
- clientSession
the client session with which to associate this operation
- newCollectionNamespace
the name the collection will be renamed to
- returns
an empty Observable that indicates when the operation has completed
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def renameCollection(newCollectionNamespace: MongoNamespace, options: RenameCollectionOptions): SingleObservable[Void]
Rename the collection with oldCollectionName to the newCollectionName.
Rename the collection with oldCollectionName to the newCollectionName.
- newCollectionNamespace
the name the collection will be renamed to
- options
the options for renaming a collection
- returns
an empty Observable that indicates when the operation has completed
- def renameCollection(newCollectionNamespace: MongoNamespace): SingleObservable[Void]
Rename the collection with oldCollectionName to the newCollectionName.
Rename the collection with oldCollectionName to the newCollectionName.
- newCollectionNamespace
the name the collection will be renamed to
- returns
an empty Observable that indicates when the operation has completed
- def replaceOne(clientSession: ClientSession, filter: Bson, replacement: TResult, options: ReplaceOptions): SingleObservable[UpdateResult]
Replace a document in the collection according to the specified arguments.
Replace a document in the collection according to the specified arguments.
- clientSession
the client session with which to associate this operation
- filter
the query filter to apply the the replace operation
- replacement
the replacement document
- options
the options to apply to the replace operation
- returns
a Observable with a single element the UpdateResult
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def replaceOne(filter: Bson, replacement: TResult, options: ReplaceOptions): SingleObservable[UpdateResult]
Replace a document in the collection according to the specified arguments.
Replace a document in the collection according to the specified arguments.
- filter
the query filter to apply the the replace operation
- replacement
the replacement document
- options
the options to apply to the replace operation
- returns
a Observable with a single element the UpdateResult
- def replaceOne(clientSession: ClientSession, filter: Bson, replacement: TResult): SingleObservable[UpdateResult]
Replace a document in the collection according to the specified arguments.
Replace a document in the collection according to the specified arguments.
- clientSession
the client session with which to associate this operation
- filter
the query filter to apply the the replace operation
- replacement
the replacement document
- returns
a Observable with a single element the UpdateResult
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def replaceOne(filter: Bson, replacement: TResult): SingleObservable[UpdateResult]
Replace a document in the collection according to the specified arguments.
Replace a document in the collection according to the specified arguments.
- filter
the query filter to apply the the replace operation
- replacement
the replacement document
- returns
a Observable with a single element the UpdateResult
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def updateMany(clientSession: ClientSession, filter: Bson, update: Seq[Bson], options: UpdateOptions): SingleObservable[UpdateResult]
Update all documents in the collection according to the specified arguments.
Update all documents in the collection according to the specified arguments.
- clientSession
the client session with which to associate this operation
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a pipeline describing the update.
- options
the options to apply to the update operation
- returns
a Observable with a single element the UpdateResult
- Since
2.7
- Note
Requires MongoDB 4.2 or greater
- def updateMany(clientSession: ClientSession, filter: Bson, update: Seq[Bson]): SingleObservable[UpdateResult]
Update all documents in the collection according to the specified arguments.
Update all documents in the collection according to the specified arguments.
- clientSession
the client session with which to associate this operation
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a pipeline describing the update.
- returns
a Observable with a single element the UpdateResult
- Since
2.7
- Note
Requires MongoDB 4.2 or greater
- def updateMany(filter: Bson, update: Seq[Bson], options: UpdateOptions): SingleObservable[UpdateResult]
Update all documents in the collection according to the specified arguments.
Update all documents in the collection according to the specified arguments.
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a pipeline describing the update.
- options
the options to apply to the update operation
- returns
a Observable with a single element the UpdateResult
- Since
2.7
- Note
Requires MongoDB 4.2 or greater
- def updateMany(filter: Bson, update: Seq[Bson]): SingleObservable[UpdateResult]
Update all documents in the collection according to the specified arguments.
Update all documents in the collection according to the specified arguments.
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a pipeline describing the update.
- returns
a Observable with a single element the UpdateResult
- Since
2.7
- Note
Requires MongoDB 4.2 or greater
- def updateMany(clientSession: ClientSession, filter: Bson, update: Bson, options: UpdateOptions): SingleObservable[UpdateResult]
Update all documents in the collection according to the specified arguments.
Update all documents in the collection according to the specified arguments.
- clientSession
the client session with which to associate this operation
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a document describing the update, which may not be null. The update to apply must include only update operators. This can be of any type for which a
Codec
is registered- options
the options to apply to the update operation
- returns
a Observable with a single element the UpdateResult
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def updateMany(clientSession: ClientSession, filter: Bson, update: Bson): SingleObservable[UpdateResult]
Update all documents in the collection according to the specified arguments.
Update all documents in the collection according to the specified arguments.
- clientSession
the client session with which to associate this operation
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a document describing the update, which may not be null. The update to apply must include only update operators. This can be of any type for which a
Codec
is registered- returns
a Observable with a single element the UpdateResult
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def updateMany(filter: Bson, update: Bson, options: UpdateOptions): SingleObservable[UpdateResult]
Update all documents in the collection according to the specified arguments.
Update all documents in the collection according to the specified arguments.
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a document describing the update, which may not be null. The update to apply must include only update operators. This can be of any type for which a
Codec
is registered- options
the options to apply to the update operation
- returns
a Observable with a single element the UpdateResult
- def updateMany(filter: Bson, update: Bson): SingleObservable[UpdateResult]
Update all documents in the collection according to the specified arguments.
Update all documents in the collection according to the specified arguments.
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a document describing the update, which may not be null. The update to apply must include only update operators. This can be of any type for which a
Codec
is registered- returns
a Observable with a single element the UpdateResult
- def updateOne(clientSession: ClientSession, filter: Bson, update: Seq[Bson], options: UpdateOptions): SingleObservable[UpdateResult]
Update a single document in the collection according to the specified arguments.
Update a single document in the collection according to the specified arguments.
- clientSession
the client session with which to associate this operation
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a pipeline describing the update.
- options
the options to apply to the update operation
- returns
a Observable with a single element the UpdateResult
- Since
2.7
- Note
Requires MongoDB 4.2 or greater
- def updateOne(clientSession: ClientSession, filter: Bson, update: Seq[Bson]): SingleObservable[UpdateResult]
Update a single document in the collection according to the specified arguments.
Update a single document in the collection according to the specified arguments.
- clientSession
the client session with which to associate this operation
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a pipeline describing the update.
- returns
a Observable with a single element the UpdateResult
- Since
2.7
- Note
Requires MongoDB 4.2 or greater
- def updateOne(filter: Bson, update: Seq[Bson], options: UpdateOptions): SingleObservable[UpdateResult]
Update a single document in the collection according to the specified arguments.
Update a single document in the collection according to the specified arguments.
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a pipeline describing the update.
- options
the options to apply to the update operation
- returns
a Observable with a single element the UpdateResult
- Since
2.7
- Note
Requires MongoDB 4.2 or greater
- def updateOne(filter: Bson, update: Seq[Bson]): SingleObservable[UpdateResult]
Update a single document in the collection according to the specified arguments.
Update a single document in the collection according to the specified arguments.
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a pipeline describing the update.
- returns
a Observable with a single element the UpdateResult
- Since
2.7
- Note
Requires MongoDB 4.2 or greater
- def updateOne(clientSession: ClientSession, filter: Bson, update: Bson, options: UpdateOptions): SingleObservable[UpdateResult]
Update a single document in the collection according to the specified arguments.
Update a single document in the collection according to the specified arguments.
- clientSession
the client session with which to associate this operation
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a document describing the update, which may not be null. The update to apply must include only update operators. This can be of any type for which a
Codec
is registered- options
the options to apply to the update operation
- returns
a Observable with a single element the UpdateResult
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def updateOne(clientSession: ClientSession, filter: Bson, update: Bson): SingleObservable[UpdateResult]
Update a single document in the collection according to the specified arguments.
Update a single document in the collection according to the specified arguments.
- clientSession
the client session with which to associate this operation
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a document describing the update, which may not be null. The update to apply must include only update operators. This can be of any type for which a
Codec
is registered- returns
a Observable with a single element the UpdateResult
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def updateOne(filter: Bson, update: Bson, options: UpdateOptions): SingleObservable[UpdateResult]
Update a single document in the collection according to the specified arguments.
Update a single document in the collection according to the specified arguments.
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a document describing the update, which may not be null. The update to apply must include only update operators. This can be of any type for which a
Codec
is registered- options
the options to apply to the update operation
- returns
a Observable with a single element the UpdateResult
- def updateOne(filter: Bson, update: Bson): SingleObservable[UpdateResult]
Update a single document in the collection according to the specified arguments.
Update a single document in the collection according to the specified arguments.
- filter
a document describing the query filter, which may not be null. This can be of any type for which a
Codec
is registered- update
a document describing the update, which may not be null. The update to apply must include only update operators. This can be of any type for which a
Codec
is registered- returns
a Observable with a single element the UpdateResult
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def watch[C](clientSession: ClientSession, pipeline: Seq[Bson])(implicit e: DefaultsTo[C, TResult], ct: ClassTag[C]): ChangeStreamObservable[C]
Creates a change stream for this collection.
Creates a change stream for this collection.
- C
the target document type of the observable.
- clientSession
the client session with which to associate this operation
- pipeline
the aggregation pipeline to apply to the change stream
- returns
the change stream observable
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def watch[C](clientSession: ClientSession)(implicit e: DefaultsTo[C, TResult], ct: ClassTag[C]): ChangeStreamObservable[C]
Creates a change stream for this collection.
Creates a change stream for this collection.
- C
the target document type of the observable.
- clientSession
the client session with which to associate this operation
- returns
the change stream observable
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def watch[C](pipeline: Seq[Bson])(implicit e: DefaultsTo[C, TResult], ct: ClassTag[C]): ChangeStreamObservable[C]
Creates a change stream for this collection.
Creates a change stream for this collection.
- C
the target document type of the observable.
- pipeline
the aggregation pipeline to apply to the change stream
- returns
the change stream observable
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def watch[C]()(implicit e: DefaultsTo[C, TResult], ct: ClassTag[C]): ChangeStreamObservable[C]
Creates a change stream for this collection.
Creates a change stream for this collection.
- C
the target document type of the observable.
- returns
the change stream observable
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def withCodecRegistry(codecRegistry: CodecRegistry): MongoCollection[TResult]
Create a new MongoCollection instance with a different codec registry.
Create a new MongoCollection instance with a different codec registry.
- codecRegistry
the new { @link org.bson.codecs.configuration.CodecRegistry} for the collection
- returns
a new MongoCollection instance with the different codec registry
- def withDocumentClass[C]()(implicit e: DefaultsTo[C, Document], ct: ClassTag[C]): MongoCollection[C]
Create a new MongoCollection instance with a different default class to cast any documents returned from the database into..
Create a new MongoCollection instance with a different default class to cast any documents returned from the database into..
- C
The type that the new collection will encode documents from and decode documents to
- returns
a new MongoCollection instance with the different default class
- def withReadConcern(readConcern: ReadConcern): MongoCollection[TResult]
Create a new MongoCollection instance with a different read concern.
Create a new MongoCollection instance with a different read concern.
- readConcern
the new ReadConcern for the collection
- returns
a new MongoCollection instance with the different ReadConcern
- Since
1.1
- def withReadPreference(readPreference: ReadPreference): MongoCollection[TResult]
Create a new MongoCollection instance with a different read preference.
Create a new MongoCollection instance with a different read preference.
- readPreference
the new { @link com.mongodb.ReadPreference} for the collection
- returns
a new MongoCollection instance with the different readPreference
- def withWriteConcern(writeConcern: WriteConcern): MongoCollection[TResult]
Create a new MongoCollection instance with a different write concern.
Create a new MongoCollection instance with a different write concern.
- writeConcern
the new { @link com.mongodb.WriteConcern} for the collection
- returns
a new MongoCollection instance with the different writeConcern
- lazy val writeConcern: WriteConcern
Get the write concern for the MongoDatabase.
Get the write concern for the MongoDatabase.
- returns
the { @link com.mongodb.WriteConcern}
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
This is the documentation for the MongoDB Scala driver.
Driver structure
The mongodb scala driver.
To get started you need a MongoClient instance, either from a connection string or via a org.mongodb.scala.MongoClientSettings.
Notable packages include: