Packages

c

mongo4cats.collection

GenericMongoCollection

abstract class GenericMongoCollection[F[_], T, S[_]] extends AnyRef

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GenericMongoCollection
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new GenericMongoCollection()

Abstract Value Members

  1. abstract def aggregate[Y](session: ClientSession[F], pipeline: Aggregate)(implicit arg0: ClassTag[Y]): AggregateQueryBuilder[F, Y, S]
  2. abstract def aggregate[Y](pipeline: Aggregate)(implicit arg0: ClassTag[Y]): AggregateQueryBuilder[F, Y, S]
  3. abstract def aggregate[Y](pipeline: Seq[Bson])(implicit arg0: ClassTag[Y]): AggregateQueryBuilder[F, Y, S]

    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

  4. abstract def as[Y](implicit arg0: ClassTag[Y]): GenericMongoCollection[F, Y, S]
  5. abstract def bulkWrite[T1 <: T](cs: ClientSession[F], commands: Seq[WriteCommand[T1]], options: BulkWriteOptions): F[BulkWriteResult]
  6. abstract def bulkWrite[T1 <: T](commands: Seq[WriteCommand[T1]], options: BulkWriteOptions): F[BulkWriteResult]

    Executes a mix of inserts, updates, replaces, and deletes.

    Executes a mix of inserts, updates, replaces, and deletes.

    https://docs.mongodb.com/manual/reference/method/db.collection.bulkWrite/

    commands

    the writes to execute

    options

    the options to apply to the bulk write operation

  7. abstract def count(session: ClientSession[F], filter: Filter, options: CountOptions): F[Long]
  8. 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

  9. abstract def createIndex(session: ClientSession[F], index: Index, options: IndexOptions): F[String]
  10. 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

  11. abstract def deleteMany(session: ClientSession[F], filter: Filter, options: DeleteOptions): F[DeleteResult]
  12. 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

  13. abstract def deleteOne(session: ClientSession[F], filter: Filter, options: DeleteOptions): F[DeleteResult]
  14. 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

  15. abstract def distinct[Y](session: ClientSession[F], fieldName: String, filter: Filter)(implicit arg0: ClassTag[Y]): DistinctQueryBuilder[F, Y, S]
  16. abstract def distinct[Y](fieldName: String, filter: Bson)(implicit arg0: ClassTag[Y]): DistinctQueryBuilder[F, Y, S]

    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/

    fieldName

    the field name

    filter

    the query filter

  17. abstract def drop(session: ClientSession[F]): F[Unit]
  18. abstract def drop: F[Unit]

    Drops this collection from the Database.

    Drops this collection from the Database.

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

  19. abstract def dropIndex(session: ClientSession[F], index: Index, options: DropIndexOptions): F[Unit]
  20. 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

  21. abstract def dropIndex(session: ClientSession[F], name: String, options: DropIndexOptions): F[Unit]
  22. abstract def dropIndex(name: String, options: DropIndexOptions): F[Unit]

    Drops the given index.

    name

    the name of the index to remove

    options

    options to use when dropping indexes

  23. abstract def dropIndexes(session: ClientSession[F], options: DropIndexOptions): F[Unit]
  24. 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

  25. abstract def find(session: ClientSession[F], filter: Filter): FindQueryBuilder[F, T, S]
  26. abstract def find(filter: Bson): FindQueryBuilder[F, T, S]

    Finds matching documents in the collection.

    Finds matching documents in the collection.

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

    filter

    the query filter

  27. abstract def findOneAndDelete(session: ClientSession[F], filter: Filter, options: FindOneAndDeleteOptions): F[Option[T]]
  28. 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

  29. abstract def findOneAndReplace(session: ClientSession[F], filter: Filter, replacement: T, options: FindOneAndReplaceOptions): F[Option[T]]
  30. 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

  31. abstract def findOneAndUpdate(session: ClientSession[F], filter: Filter, update: Update, options: FindOneAndUpdateOptions): F[Option[T]]
  32. 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

  33. abstract def insertMany(session: ClientSession[F], documents: Seq[T], options: InsertManyOptions): F[InsertManyResult]
  34. 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

  35. abstract def insertOne(session: ClientSession[F], document: T, options: InsertOneOptions): F[InsertOneResult]
  36. 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

  37. abstract def listIndexes[Y](cs: ClientSession[F])(implicit arg0: ClassTag[Y]): F[Iterable[Y]]
  38. abstract def listIndexes: F[Iterable[Document]]
  39. abstract def listIndexes[Y](implicit arg0: ClassTag[Y]): F[Iterable[Y]]
  40. abstract def listIndexes(session: ClientSession[F]): F[Iterable[Document]]

    Get all the indexes in this collection.

    session

    the client session with which to associate this operation

  41. abstract def renameCollection(session: ClientSession[F], target: MongoNamespace, options: RenameCollectionOptions): F[Unit]
  42. abstract def renameCollection(target: MongoNamespace, options: RenameCollectionOptions): F[Unit]

    Rename the collection with oldCollectionName to the newCollectionName.

    Rename the collection with oldCollectionName to the newCollectionName.

    https://docs.mongodb.com/manual/reference/method/db.collection.renameCollection/

    target

    the name the collection will be renamed to

    options

    the options for renaming a collection

  43. abstract def replaceOne(session: ClientSession[F], filter: Filter, replacement: T, options: ReplaceOptions): F[UpdateResult]
  44. 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

  45. abstract def underlying: MongoCollection[T]
  46. 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

  47. abstract def updateMany(session: ClientSession[F], filter: Filter, update: Update, options: UpdateOptions): F[UpdateResult]
  48. 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

  49. 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

  50. abstract def updateOne(session: ClientSession[F], filter: Filter, update: Update, options: UpdateOptions): F[UpdateResult]
  51. 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

  52. abstract def watch(session: ClientSession[F], pipeline: Aggregate): WatchQueryBuilder[F, Document, S]
  53. abstract def watch(pipeline: Aggregate): WatchQueryBuilder[F, Document, S]
  54. abstract def watch(pipeline: Seq[Bson]): WatchQueryBuilder[F, Document, S]

    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

  55. abstract def withAddedCodec(codecRegistry: CodecRegistry): GenericMongoCollection[F, T, S]
  56. abstract def withReadConcern(readConcern: ReadConcern): GenericMongoCollection[F, T, S]
  57. abstract def withReadPreference(readPreference: ReadPreference): GenericMongoCollection[F, T, S]
  58. abstract def withWriteConcern(writeConcert: WriteConcern): GenericMongoCollection[F, T, S]

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def aggregateWithCodec[Y](session: ClientSession[F], pipeline: Aggregate)(implicit arg0: ClassTag[Y], arg1: MongoCodecProvider[Y]): AggregateQueryBuilder[F, Y, S]
  5. def aggregateWithCodec[Y](pipeline: Aggregate)(implicit arg0: ClassTag[Y], arg1: MongoCodecProvider[Y]): AggregateQueryBuilder[F, Y, S]
  6. def aggregateWithCodec[Y](pipeline: Seq[Bson])(implicit arg0: ClassTag[Y], arg1: MongoCodecProvider[Y]): AggregateQueryBuilder[F, Y, S]
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def bulkWrite[T1 <: T](cs: ClientSession[F], commands: Seq[WriteCommand[T1]]): F[BulkWriteResult]
  9. def bulkWrite[T1 <: T](commands: Seq[WriteCommand[T1]]): F[BulkWriteResult]
  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  11. def codecs: CodecRegistry
  12. def count(session: ClientSession[F]): F[Long]
  13. def count: F[Long]

    Counts the number of documents in the collection.

    Counts the number of documents in the collection.

    Since

    2.4

  14. def count(session: ClientSession[F], filter: Filter): F[Long]
  15. def count(filter: Filter): F[Long]
  16. def count(filter: Bson): F[Long]
  17. def count(filter: Filter, options: CountOptions): F[Long]
  18. def createIndex(session: ClientSession[F], index: Index): F[String]
  19. def createIndex(index: Index): F[String]
  20. def createIndex(key: Bson): F[String]
  21. def createIndex(index: Index, options: IndexOptions): F[String]
  22. def deleteMany(session: ClientSession[F], filters: Filter): F[DeleteResult]
  23. def deleteMany(filters: Filter): F[DeleteResult]
  24. def deleteMany(filters: Bson): F[DeleteResult]
  25. def deleteMany(filter: Filter, options: DeleteOptions): F[DeleteResult]
  26. def deleteOne(session: ClientSession[F], filter: Filter): F[DeleteResult]
  27. def deleteOne(filter: Filter): F[DeleteResult]
  28. def deleteOne(filters: Bson): F[DeleteResult]
  29. def deleteOne(filter: Filter, options: DeleteOptions): F[DeleteResult]
  30. def distinct[Y](session: ClientSession[F], fieldName: String)(implicit arg0: ClassTag[Y]): DistinctQueryBuilder[F, Y, S]
  31. def distinct[Y](fieldName: String)(implicit arg0: ClassTag[Y]): DistinctQueryBuilder[F, Y, S]

    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

  32. def distinct[Y](fieldName: String, filter: Filter)(implicit arg0: ClassTag[Y]): DistinctQueryBuilder[F, Y, S]
  33. def distinctWithCodec[Y](session: ClientSession[F], fieldName: String)(implicit arg0: MongoCodecProvider[Y], arg1: ClassTag[Y]): DistinctQueryBuilder[F, Y, S]
  34. def distinctWithCodec[Y](fieldName: String)(implicit arg0: MongoCodecProvider[Y], arg1: ClassTag[Y]): DistinctQueryBuilder[F, Y, S]
  35. def distinctWithCodec[Y](session: ClientSession[F], fieldName: String, filter: Filter)(implicit arg0: MongoCodecProvider[Y], arg1: ClassTag[Y]): DistinctQueryBuilder[F, Y, S]
  36. def distinctWithCodec[Y](fieldName: String, filter: Filter)(implicit arg0: MongoCodecProvider[Y], arg1: ClassTag[Y]): DistinctQueryBuilder[F, Y, S]
  37. def distinctWithCodec[Y](fieldName: String, filter: Bson)(implicit arg0: MongoCodecProvider[Y], arg1: ClassTag[Y]): DistinctQueryBuilder[F, Y, S]
  38. def documentClass: Class[T]
  39. def dropIndex(session: ClientSession[F], index: Index): F[Unit]
  40. def dropIndex(index: Index): F[Unit]
  41. def dropIndex(keys: Bson): F[Unit]
  42. def dropIndex(index: Index, options: DropIndexOptions): F[Unit]
  43. def dropIndex(session: ClientSession[F], name: String): F[Unit]
  44. def dropIndex(name: String): F[Unit]
  45. def dropIndexes(session: ClientSession[F]): F[Unit]
  46. def dropIndexes: F[Unit]
  47. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  48. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  49. def find(session: ClientSession[F]): FindQueryBuilder[F, T, S]
  50. def find: FindQueryBuilder[F, T, S]

    Finds all documents in the collection.

    Finds all documents in the collection.

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

  51. def find(filter: Filter): FindQueryBuilder[F, T, S]
  52. def findOneAndDelete(session: ClientSession[F], filter: Filter): F[Option[T]]
  53. def findOneAndDelete(filter: Filter): F[Option[T]]
  54. def findOneAndDelete(filter: Bson): F[Option[T]]
  55. def findOneAndDelete(filter: Filter, options: FindOneAndDeleteOptions): F[Option[T]]
  56. def findOneAndReplace(session: ClientSession[F], filter: Filter, replacement: T): F[Option[T]]
  57. def findOneAndReplace(filter: Filter, replacement: T): F[Option[T]]
  58. def findOneAndReplace(filter: Bson, replacement: T): F[Option[T]]
  59. def findOneAndReplace(filter: Filter, replacement: T, options: FindOneAndReplaceOptions): F[Option[T]]
  60. def findOneAndUpdate(session: ClientSession[F], filter: Filter, update: Update): F[Option[T]]
  61. def findOneAndUpdate(filter: Filter, update: Update): F[Option[T]]
  62. def findOneAndUpdate(filter: Bson, update: Bson): F[Option[T]]
  63. def findOneAndUpdate(filter: Filter, update: Update, options: FindOneAndUpdateOptions): F[Option[T]]
  64. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  65. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  66. def insertMany(session: ClientSession[F], documents: Seq[T]): F[InsertManyResult]
  67. def insertMany(documents: Seq[T]): F[InsertManyResult]
  68. def insertOne(session: ClientSession[F], document: T): F[InsertOneResult]
  69. def insertOne(document: T): F[InsertOneResult]
  70. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  71. def namespace: MongoNamespace
  72. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  73. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  74. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  75. def readConcern: ReadConcern
  76. def readPreference: ReadPreference
  77. def renameCollection(session: ClientSession[F], target: MongoNamespace): F[Unit]
  78. def renameCollection(target: MongoNamespace): F[Unit]
  79. def replaceOne(session: ClientSession[F], filters: Filter, replacement: T): F[UpdateResult]
  80. def replaceOne(filters: Filter, replacement: T): F[UpdateResult]
  81. def replaceOne(filters: Bson, replacement: T): F[UpdateResult]
  82. def replaceOne(filter: Filter, replacement: T, options: ReplaceOptions): F[UpdateResult]
  83. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  84. def toString(): String
    Definition Classes
    AnyRef → Any
  85. def updateMany(session: ClientSession[F], filter: Filter, update: Update): F[UpdateResult]
  86. def updateMany(filters: Filter, update: Update): F[UpdateResult]
  87. def updateMany(filters: Bson, update: Bson): F[UpdateResult]
  88. def updateMany(filter: Filter, update: Update, options: UpdateOptions): F[UpdateResult]
  89. def updateOne(filters: Bson, update: Seq[Bson]): F[UpdateResult]
  90. def updateOne(session: ClientSession[F], filters: Filter, update: Update): F[UpdateResult]
  91. def updateOne(filters: Filter, update: Update): F[UpdateResult]
  92. def updateOne(filters: Bson, update: Bson): F[UpdateResult]
  93. def updateOne(filter: Filter, update: Update, options: UpdateOptions): F[UpdateResult]
  94. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  95. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  96. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  97. def watch(session: ClientSession[F]): WatchQueryBuilder[F, Document, S]
  98. def watch: WatchQueryBuilder[F, Document, S]

    Creates a change stream for this collection.

    Creates a change stream for this collection.

    Since

    2.2

    Note

    Requires MongoDB 3.6 or greater

  99. def withAddedCodec[Y](implicit classTag: ClassTag[Y], cp: MongoCodecProvider[Y]): GenericMongoCollection[F, T, S]
  100. def withNewDocumentClass[Y](coll: MongoCollection[T])(implicit arg0: ClassTag[Y]): MongoCollection[Y]
    Attributes
    protected
  101. def writeConcern: WriteConcern

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped