MongoCollectionF

final class MongoCollectionF[T]
Companion
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def aggregate(pipeline: Seq[Bson]): AggregateQueryBuilder[T]

Aggregates documents according to the specified aggregation pipeline. http://docs.mongodb.org/manual/aggregation/

Aggregates documents according to the specified aggregation pipeline. http://docs.mongodb.org/manual/aggregation/

Value Params
pipeline

the aggregate pipeline

def count[F[_]](`evidence$34`: Async[F]): F[Long]

Counts the number of documents in the collection.

Counts the number of documents in the collection.

Since

2.4

def count[F[_]](filter: Bson)(`evidence$35`: Async[F]): 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.

Value Params
filter

the query filter

Since

2.4

def count[F[_]](filter: Bson, options: CountOptions)(`evidence$36`: Async[F]): 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.

Value Params
filter

the query filter

options

the options describing the count

Since

2.4

def createIndex[F[_]](filters: Bson)(`evidence$14`: Async[F]): F[String]
Value Params
filters

an object describing the index key(s), which may not be null. This can be of any type for which a Codec is registered

def createIndex[F[_]](filter: Bson, options: IndexOptions)(`evidence$15`: Async[F]): F[String]
Value Params
filter

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

def deleteMany[F[_]](filters: Bson)(`evidence$28`: Async[F]): F[DeleteResult]

Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.

Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.

Value Params
filters

the query filter to apply the the delete operation

def deleteMany[F[_]](filter: Bson, options: DeleteOptions)(`evidence$29`: Async[F]): F[DeleteResult]

Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.

Removes all documents from the collection that match the given query filter. If no documents match, the collection is not modified.

Value Params
filter

the query filter to apply the the delete operation

options

the options to apply to the delete operation

Since

1.2

def deleteOne[F[_]](filters: Bson)(`evidence$26`: Async[F]): F[DeleteResult]

Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.

Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.

Value Params
filters

the query filter to apply the the delete operation

def deleteOne[F[_]](filter: Bson, options: DeleteOptions)(`evidence$27`: Async[F]): F[DeleteResult]

Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.

Removes at most one document from the collection that matches the given filter. If no documents match, the collection is not modified.

Value Params
filter

the query filter to apply the the delete operation

options

the options to apply to the delete operation

Since

1.2

def distinct(fieldName: String): DistinctQueryBuilder[T]

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

Value Params
fieldName

the field name

def distinct(fieldName: String, filter: Bson): DistinctQueryBuilder[T]

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/

Value Params
fieldName

the field name

filter

the query filter

def documentClass: Class[T]
def drop[F[_]](`evidence$13`: Async[F]): F[Unit]

Drops this collection from the Database.

Drops this collection from the Database.

http://docs.mongodb.org/manual/reference/command/drop/

def dropIndex[F[_]](name: String)(`evidence$8`: Async[F]): F[Unit]

Drops the given index.

Value Params
name

the name of the index to remove

def dropIndex[F[_]](keys: Bson)(`evidence$9`: Async[F]): F[Unit]

Drops the index given the keys used to create it.

Drops the index given the keys used to create it.

Value Params
keys

the keys of the index to remove

def dropIndex[F[_]](keys: Bson, options: DropIndexOptions)(`evidence$10`: Async[F]): F[Unit]

Drops the index given the keys used to create it.

Drops the index given the keys used to create it.

Value Params
keys

the keys of the index to remove

options

options to use when dropping indexes

Since

2.2

def dropIndexes[F[_]](options: DropIndexOptions)(`evidence$11`: Async[F]): 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/

Value Params
options

options to use when dropping indexes

Since

2.2

def dropIndexes[F[_]](`evidence$12`: Async[F]): 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/

Finds all documents in the collection.

Finds all documents in the collection.

http://docs.mongodb.org/manual/tutorial/query-documents/

def find(filter: Bson): FindQueryBuilder[T]

Finds all documents in the collection.

Finds all documents in the collection.

http://docs.mongodb.org/manual/tutorial/query-documents/

Value Params
filter

the query filter

def findOneAndDelete[F[_]](filter: Bson)(`evidence$2`: Async[F]): F[T]

Atomically find a document and remove it.

Atomically find a document and remove it.

Value Params
filter

the query filter to find the document with

Note

If no documents matched the query filter, then null will be returned

def findOneAndDelete[F[_]](filter: Bson, options: FindOneAndDeleteOptions)(`evidence$3`: Async[F]): F[T]

Atomically find a document and remove it.

Atomically find a document and remove it.

Value Params
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 null will be returned

def findOneAndReplace[F[_]](filter: Bson, replacement: T)(`evidence$6`: Async[F]): F[T]

Atomically find a document and replace it.

Atomically find a document and replace it.

Value Params
filter

the query filter to apply the the replace operation

replacement

the replacement document

Note

If no documents matched the query filter, then null will be returned

def findOneAndReplace[F[_]](filter: Bson, replacement: T, options: FindOneAndReplaceOptions)(`evidence$7`: Async[F]): F[T]

Atomically find a document and replace it.

Atomically find a document and replace it.

Value Params
filter

the query filter to apply the the replace operation

options

the options to apply to the operation

replacement

the replacement document

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 null will be returned

def findOneAndUpdate[F[_]](filter: Bson, update: Bson)(`evidence$4`: Async[F]): F[T]

Atomically find a document and update it.

Atomically find a document and update it.

Value Params
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

Note

If no documents matched the query filter, then null will be returned

def findOneAndUpdate[F[_]](filter: Bson, update: Bson, options: FindOneAndUpdateOptions)(`evidence$5`: Async[F]): F[T]

Atomically find a document and update it.

Atomically find a document and update it.

Value Params
filter

a document describing the query filter, which may not be null. This can be of any type for which a Codec is registered

options

the options to apply to the operation

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

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 null will be returned

def insertMany[F[_]](documents: Seq[T])(`evidence$32`: Async[F]): F[InsertManyResult]

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.

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.

Value Params
documents

the documents to insert

def insertMany[F[_]](documents: Seq[T], options: InsertManyOptions)(`evidence$33`: Async[F]): F[InsertManyResult]

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.

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.

Value Params
documents

the documents to insert

options

the options to apply to the operation

def insertOne[F[_]](document: T)(`evidence$30`: Async[F]): F[InsertOneResult]

Inserts the provided document. If the document is missing an identifier, the driver should generate one.

Inserts the provided document. If the document is missing an identifier, the driver should generate one.

Value Params
document

the document to insert

def insertOne[F[_]](document: T, options: InsertOneOptions)(`evidence$31`: Async[F]): F[InsertOneResult]

Inserts the provided document. If the document is missing an identifier, the driver should generate one.

Inserts the provided document. If the document is missing an identifier, the driver should generate one.

Value Params
document

the document to insert

options

the options to apply to the operation

Since

1.1

def namespace: MongoNamespace
def replaceOne[F[_]](filters: Bson, replacement: T)(`evidence$24`: Async[F]): 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

Value Params
filters

the query filter to apply the the replace operation

replacement

the replacement document

def replaceOne[F[_]](filter: Bson, replacement: T, options: ReplaceOptions)(`evidence$25`: Async[F]): 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

Value Params
filter

the query filter to apply the the replace operation

options

the options to apply to the replace operation

replacement

the replacement document

def updateMany[F[_]](filters: Bson, update: Bson)(`evidence$16`: Async[F]): 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/

Value Params
filters

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

def updateMany[F[_]](filters: Bson, update: Seq[Bson])(`evidence$17`: Async[F]): 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/

Value Params
filters

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.

Since

2.7

Note

Requires MongoDB 4.2 or greater

def updateMany[F[_]](filter: Bson, update: Bson, options: UpdateOptions)(`evidence$18`: Async[F]): 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/

Value Params
filter

a document describing the query filter, which may not be null. This can be of any type for which a Codec is registered

options

the options to apply to the update operation

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

def updateMany[F[_]](filter: Bson, update: Seq[Bson], options: UpdateOptions)(`evidence$19`: Async[F]): 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/

Value Params
filter

a document describing the query filter, which may not be null. This can be of any type for which a Codec is registered

options

the options to apply to the update operation

update

a pipeline describing the update.

Since

2.7

Note

Requires MongoDB 4.2 or greater

def updateOne[F[_]](filters: Bson, update: Bson)(`evidence$20`: Async[F]): 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/

Value Params
filters

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

def updateOne[F[_]](filters: Bson, update: Seq[Bson])(`evidence$21`: Async[F]): 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/

Value Params
filters

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

Since

2.7

Note

Requires MongoDB 4.2 or greater

def updateOne[F[_]](filter: Bson, update: Bson, options: UpdateOptions)(`evidence$22`: Async[F]): 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/

Value Params
filter

a document describing the query filter, which may not be null. This can be of any type for which a Codec is registered

options

the options to apply to the update operation

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

def updateOne[F[_]](filter: Bson, update: Seq[Bson], options: UpdateOptions)(`evidence$23`: Async[F]): 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/

Value Params
filter

a document describing the query filter, which may not be null. This can be of any type for which a Codec is registered

options

the options to apply to the update operation

update

a pipeline describing the update.

Since

2.7

Note

Requires MongoDB 4.2 or greater

def watch(pipeline: Seq[Bson]): WatchQueryBuilder[T]

Creates a change stream for this collection.

Creates a change stream for this collection.

Value Params
pipeline

the aggregation pipeline to apply to the change stream

Since

2.2

Note

Requires MongoDB 3.6 or greater

Creates a change stream for this collection.

Creates a change stream for this collection.

Since

2.2

Note

Requires MongoDB 3.6 or greater