abstract class MongoCollection[F[_], T] extends AnyRef
- Alphabetic
- By Inheritance
- MongoCollection
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new MongoCollection()
Abstract Value Members
- abstract def aggregate[Y](session: ClientSession[F], pipeline: Aggregate)(implicit arg0: ClassTag[Y]): AggregateQueryBuilder[F, Y]
- abstract def aggregate[Y](pipeline: Aggregate)(implicit arg0: ClassTag[Y]): AggregateQueryBuilder[F, Y]
- abstract def aggregate[Y](pipeline: Seq[Bson])(implicit arg0: ClassTag[Y]): AggregateQueryBuilder[F, Y]
Aggregates documents according to the specified aggregation pipeline.
Aggregates documents according to the specified aggregation pipeline. http://docs.mongodb.org/manual/aggregation/
- pipeline
the aggregate pipeline
- abstract def as[Y](implicit arg0: ClassTag[Y]): MongoCollection[F, Y]
- abstract def codecs: CodecRegistry
- abstract def count(session: ClientSession[F], filter: Filter, options: CountOptions): F[Long]
- abstract def count(filter: Bson, options: CountOptions): F[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.
- filter
the query filter
- options
the options describing the count
- Since
2.4
- abstract def createIndex(session: ClientSession[F], index: Index, options: IndexOptions): F[String]
- abstract def createIndex(key: Bson, options: IndexOptions): F[String]
http://docs.mongodb.org/manual/reference/command/create
- key
an object describing the index key(s). This can be of any type for which a
Codec
is registered- options
the options for the index
- abstract def deleteMany(session: ClientSession[F], filter: Filter, options: DeleteOptions): F[DeleteResult]
- abstract def deleteMany(filter: Bson, options: DeleteOptions): F[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
- Since
1.2
- abstract def deleteOne(session: ClientSession[F], filter: Filter, options: DeleteOptions): F[DeleteResult]
- abstract def deleteOne(filter: Bson, options: DeleteOptions): F[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
- Since
1.2
- abstract def distinct[Y](session: ClientSession[F], fieldName: String, filter: Filter)(implicit arg0: ClassTag[Y]): DistinctQueryBuilder[F, Y]
- abstract def distinct[Y](fieldName: String, filter: Bson)(implicit arg0: ClassTag[Y]): DistinctQueryBuilder[F, Y]
Gets the distinct values of the specified field name.
Gets the distinct values of the specified field name.
- fieldName
the field name
- filter
the query filter
- abstract def documentClass: Class[T]
- abstract def drop(session: ClientSession[F]): F[Unit]
- abstract def drop: F[Unit]
Drops this collection from the Database.
Drops this collection from the Database.
- abstract def dropIndex(session: ClientSession[F], index: Index, options: DropIndexOptions): F[Unit]
- abstract def dropIndex(keys: Bson, options: DropIndexOptions): F[Unit]
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
- options
options to use when dropping indexes
- Since
2.2
- abstract def dropIndex(session: ClientSession[F], name: String, options: DropIndexOptions): F[Unit]
- abstract def dropIndex(name: String, options: DropIndexOptions): F[Unit]
Drops the given index.
Drops the given index.
http://docs.mongodb.org/manual/reference/command/dropIndexes/
- name
the name of the index to remove
- options
options to use when dropping indexes
- abstract def dropIndexes(session: ClientSession[F], options: DropIndexOptions): F[Unit]
- abstract def dropIndexes(options: DropIndexOptions): F[Unit]
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.
http://docs.mongodb.org/manual/reference/command/dropIndexes/
- options
options to use when dropping indexes
- Since
2.2
- abstract def find(session: ClientSession[F], filter: Filter): FindQueryBuilder[F, T]
- abstract def find(filter: Bson): FindQueryBuilder[F, T]
Finds matching documents in the collection.
Finds matching documents in the collection.
- filter
the query filter
- abstract def findOneAndDelete(session: ClientSession[F], filter: Filter, options: FindOneAndDeleteOptions): F[Option[T]]
- abstract def findOneAndDelete(filter: Bson, options: FindOneAndDeleteOptions): F[Option[T]]
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
- Note
If no documents matched the query filter, then None will be returned
- abstract def findOneAndReplace(session: ClientSession[F], filter: Filter, replacement: T, options: FindOneAndReplaceOptions): F[Option[T]]
- abstract def findOneAndReplace(filter: Bson, replacement: T, options: FindOneAndReplaceOptions): F[Option[T]]
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
- Note
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 None will be returned
- abstract def findOneAndUpdate(session: ClientSession[F], filter: Filter, update: Update, options: FindOneAndUpdateOptions): F[Option[T]]
- abstract def findOneAndUpdate(filter: Bson, update: Bson, options: FindOneAndUpdateOptions): F[Option[T]]
Atomically find a document and update it.
Atomically find a document and update it.
- filter
a document describing the query filter. This can be of any type for which a
Codec
is registered- update
a document describing the update. 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
- Note
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 None will be returned
- abstract def insertMany(session: ClientSession[F], documents: Seq[T], options: InsertManyOptions): F[InsertManyResult]
- abstract def insertMany(documents: Seq[T], options: InsertManyOptions): F[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
- abstract def insertOne(session: ClientSession[F], document: T, options: InsertOneOptions): F[InsertOneResult]
- abstract def insertOne(document: T, options: InsertOneOptions): F[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
- Since
1.1
- abstract def namespace: MongoNamespace
- abstract def readConcern: ReadConcern
- abstract def readPreference: ReadPreference
- abstract def replaceOne(session: ClientSession[F], filter: Filter, replacement: T, options: ReplaceOptions): F[UpdateResult]
- abstract def replaceOne(filter: Bson, replacement: T, options: ReplaceOptions): F[UpdateResult]
Replace a document in the collection according to the specified arguments.
Replace a document in the collection according to the specified arguments.
http://docs.mongodb.org/manual/tutorial/modify-documents/#replace-the-document
- filter
the query filter to apply the the replace operation
- replacement
the replacement document
- options
the options to apply to the replace operation
- abstract def updateMany(filter: Bson, update: Seq[Bson], options: UpdateOptions): F[UpdateResult]
Update all documents in the collection according to the specified arguments.
Update all documents in the collection according to the specified arguments.
http://docs.mongodb.org/manual/tutorial/modify-documents/ http://docs.mongodb.org/manual/reference/operator/update/
- filter
a document describing the query filter. 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
- Since
2.7
- Note
Requires MongoDB 4.2 or greater
- abstract def updateMany(session: ClientSession[F], filter: Filter, update: Update, options: UpdateOptions): F[UpdateResult]
- abstract def updateMany(filter: Bson, update: Bson, options: UpdateOptions): F[UpdateResult]
Update all documents in the collection according to the specified arguments.
Update all documents in the collection according to the specified arguments.
http://docs.mongodb.org/manual/tutorial/modify-documents/ http://docs.mongodb.org/manual/reference/operator/update/
- filter
a document describing the query filter. This can be of any type for which a
Codec
is registered- update
a document describing the update. 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
- abstract def updateOne(filter: Bson, update: Seq[Bson], options: UpdateOptions): F[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.
http://docs.mongodb.org/manual/tutorial/modify-documents/ http://docs.mongodb.org/manual/reference/operator/update/
- filter
a document describing the query filter. 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
- Since
2.7
- Note
Requires MongoDB 4.2 or greater
- abstract def updateOne(session: ClientSession[F], filter: Filter, update: Update, options: UpdateOptions): F[UpdateResult]
- abstract def updateOne(filter: Bson, update: Bson, options: UpdateOptions): F[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.
http://docs.mongodb.org/manual/tutorial/modify-documents/ http://docs.mongodb.org/manual/reference/operator/update/
- filter
a document describing the query filter. This can be of any type for which a
Codec
is registered- update
a document describing the update. 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
- abstract def watch[Y](session: ClientSession[F], pipeline: Aggregate)(implicit arg0: ClassTag[Y]): WatchQueryBuilder[F, Y]
- abstract def watch[Y](pipeline: Aggregate)(implicit arg0: ClassTag[Y]): WatchQueryBuilder[F, Y]
- abstract def watch[Y](pipeline: Seq[Bson])(implicit arg0: ClassTag[Y]): WatchQueryBuilder[F, Y]
Creates a change stream for this collection.
Creates a change stream for this collection.
- pipeline
the aggregation pipeline to apply to the change stream
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- abstract def witReadConcern(readConcern: ReadConcern): MongoCollection[F, T]
- abstract def withAddedCodec(codecRegistry: CodecRegistry): MongoCollection[F, T]
- abstract def withReadPreference(readPreference: ReadPreference): MongoCollection[F, T]
- abstract def withWriteConcern(writeConcert: WriteConcern): MongoCollection[F, T]
- abstract def writeConcern: WriteConcern
Concrete 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 aggregateWithCodec[Y](session: ClientSession[F], pipeline: Aggregate)(implicit arg0: ClassTag[Y], arg1: MongoCodecProvider[Y]): AggregateQueryBuilder[F, Y]
- def aggregateWithCodec[Y](pipeline: Aggregate)(implicit arg0: ClassTag[Y], arg1: MongoCodecProvider[Y]): AggregateQueryBuilder[F, Y]
- def aggregateWithCodec[Y](pipeline: Seq[Bson])(implicit arg0: ClassTag[Y], arg1: MongoCodecProvider[Y]): AggregateQueryBuilder[F, Y]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException])
- def count(session: ClientSession[F]): F[Long]
- def count: F[Long]
Counts the number of documents in the collection.
Counts the number of documents in the collection.
- Since
2.4
- def count(session: ClientSession[F], filter: Filter): F[Long]
- def count(filter: Filter): F[Long]
- def count(filter: Bson): F[Long]
- def count(filter: Filter, options: CountOptions): F[Long]
- def createIndex(session: ClientSession[F], index: Index): F[String]
- def createIndex(index: Index): F[String]
- def createIndex(key: Bson): F[String]
- def createIndex(index: Index, options: IndexOptions): F[String]
- def deleteMany(session: ClientSession[F], filters: Filter): F[DeleteResult]
- def deleteMany(filters: Filter): F[DeleteResult]
- def deleteMany(filters: Bson): F[DeleteResult]
- def deleteMany(filter: Filter, options: DeleteOptions): F[DeleteResult]
- def deleteOne(session: ClientSession[F], filter: Filter): F[DeleteResult]
- def deleteOne(filter: Filter): F[DeleteResult]
- def deleteOne(filters: Bson): F[DeleteResult]
- def deleteOne(filter: Filter, options: DeleteOptions): F[DeleteResult]
- def distinct[Y](session: ClientSession[F], fieldName: String)(implicit arg0: ClassTag[Y]): DistinctQueryBuilder[F, Y]
- def distinct[Y](fieldName: String)(implicit arg0: ClassTag[Y]): DistinctQueryBuilder[F, Y]
Gets the distinct values of the specified field name.
Gets the distinct values of the specified field name.
http://docs.mongodb.org/manual/reference/command/distinct/Distinct
- fieldName
the field name
- def distinct[Y](fieldName: String, filter: Filter)(implicit arg0: ClassTag[Y]): DistinctQueryBuilder[F, Y]
- def distinctWithCodec[Y](session: ClientSession[F], fieldName: String)(implicit arg0: MongoCodecProvider[Y], arg1: ClassTag[Y]): DistinctQueryBuilder[F, Y]
- def distinctWithCodec[Y](fieldName: String)(implicit arg0: MongoCodecProvider[Y], arg1: ClassTag[Y]): DistinctQueryBuilder[F, Y]
- def distinctWithCodec[Y](session: ClientSession[F], fieldName: String, filter: Filter)(implicit arg0: MongoCodecProvider[Y], arg1: ClassTag[Y]): DistinctQueryBuilder[F, Y]
- def distinctWithCodec[Y](fieldName: String, filter: Filter)(implicit arg0: MongoCodecProvider[Y], arg1: ClassTag[Y]): DistinctQueryBuilder[F, Y]
- def distinctWithCodec[Y](fieldName: String, filter: Bson)(implicit arg0: MongoCodecProvider[Y], arg1: ClassTag[Y]): DistinctQueryBuilder[F, Y]
- def dropIndex(session: ClientSession[F], index: Index): F[Unit]
- def dropIndex(index: Index): F[Unit]
- def dropIndex(keys: Bson): F[Unit]
- def dropIndex(index: Index, options: DropIndexOptions): F[Unit]
- def dropIndex(session: ClientSession[F], name: String): F[Unit]
- def dropIndex(name: String): F[Unit]
- def dropIndexes(session: ClientSession[F]): F[Unit]
- def dropIndexes: F[Unit]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def find(session: ClientSession[F]): FindQueryBuilder[F, T]
- def find: FindQueryBuilder[F, T]
Finds all documents in the collection.
Finds all documents in the collection.
- def find(filter: Filter): FindQueryBuilder[F, T]
- def findOneAndDelete(session: ClientSession[F], filter: Filter): F[Option[T]]
- def findOneAndDelete(filter: Filter): F[Option[T]]
- def findOneAndDelete(filter: Bson): F[Option[T]]
- def findOneAndDelete(filter: Filter, options: FindOneAndDeleteOptions): F[Option[T]]
- def findOneAndReplace(session: ClientSession[F], filter: Filter, replacement: T): F[Option[T]]
- def findOneAndReplace(filter: Filter, replacement: T): F[Option[T]]
- def findOneAndReplace(filter: Bson, replacement: T): F[Option[T]]
- def findOneAndReplace(filter: Filter, replacement: T, options: FindOneAndReplaceOptions): F[Option[T]]
- def findOneAndUpdate(session: ClientSession[F], filter: Filter, update: Update): F[Option[T]]
- def findOneAndUpdate(filter: Filter, update: Update): F[Option[T]]
- def findOneAndUpdate(filter: Bson, update: Bson): F[Option[T]]
- def findOneAndUpdate(filter: Filter, update: Update, options: FindOneAndUpdateOptions): F[Option[T]]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- def insertMany(session: ClientSession[F], documents: Seq[T]): F[InsertManyResult]
- def insertMany(documents: Seq[T]): F[InsertManyResult]
- def insertOne(session: ClientSession[F], document: T): F[InsertOneResult]
- def insertOne(document: T): F[InsertOneResult]
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def replaceOne(session: ClientSession[F], filters: Filter, replacement: T): F[UpdateResult]
- def replaceOne(filters: Filter, replacement: T): F[UpdateResult]
- def replaceOne(filters: Bson, replacement: T): F[UpdateResult]
- def replaceOne(filter: Filter, replacement: T, options: ReplaceOptions): F[UpdateResult]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def updateMany(session: ClientSession[F], filter: Filter, update: Update): F[UpdateResult]
- def updateMany(filters: Filter, update: Update): F[UpdateResult]
- def updateMany(filters: Bson, update: Bson): F[UpdateResult]
- def updateMany(filter: Filter, update: Update, options: UpdateOptions): F[UpdateResult]
- def updateOne(filters: Bson, update: Seq[Bson]): F[UpdateResult]
- def updateOne(session: ClientSession[F], filters: Filter, update: Update): F[UpdateResult]
- def updateOne(filters: Filter, update: Update): F[UpdateResult]
- def updateOne(filters: Bson, update: Bson): F[UpdateResult]
- def updateOne(filter: Filter, update: Update, options: UpdateOptions): F[UpdateResult]
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def watch[Y](session: ClientSession[F])(implicit arg0: ClassTag[Y]): WatchQueryBuilder[F, Y]
- def watch[Y](implicit arg0: ClassTag[Y]): WatchQueryBuilder[F, Y]
Creates a change stream for this collection.
Creates a change stream for this collection.
- Since
2.2
- Note
Requires MongoDB 3.6 or greater
- def withAddedCodec[Y](implicit classTag: ClassTag[Y], cp: MongoCodecProvider[Y]): MongoCollection[F, T]
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated