Class/Object

reactivemongo.api.collections.bson

BSONCollection

Related Docs: object BSONCollection | package bson

Permalink

final class BSONCollection extends Product with GenericCollection[BSONSerializationPack.type] with Serializable with Serializable

Annotations
@SerialVersionUID()
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BSONCollection
  2. Serializable
  3. Serializable
  4. GenericCollection
  5. ImplicitCommandHelpers
  6. CollectionMetaCommands
  7. GenericCollectionWithCommands
  8. Collection
  9. Product
  10. Equals
  11. AnyRef
  12. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new BSONCollection(db: DB, name: String, failoverStrategy: FailoverStrategy, readPreference: ReadPreference)

    Permalink

Type Members

  1. type AggregationFramework = AggregationFramework.type

    Permalink

    Alias for type of the aggregation framework, depending on the type of the collection.

    Alias for type of the aggregation framework, depending on the type of the collection.

    Definition Classes
    GenericCollection
    See also

    reactivemongo.api.commands.AggregationFramework

  2. final class Aggregator[T, AC[_] <: Cursor[_]] extends AnyRef

    Permalink
    Definition Classes
    GenericCollection
  3. final class AggregatorContext[T] extends AnyRef

    Permalink
    Definition Classes
    GenericCollection
  4. sealed trait BulkMaker[R, S <: BulkMaker[R, S]] extends AnyRef

    Permalink
    Attributes
    protected
    Definition Classes
    GenericCollection
  5. trait ImplicitlyDocumentProducer extends AnyRef

    Permalink
    Definition Classes
    ImplicitCommandHelpers
  6. class Mongo26WriteCommand extends BulkMaker[WriteResult, Mongo26WriteCommand]

    Permalink
    Attributes
    protected
    Definition Classes
    GenericCollection
  7. type PipelineOperator = commands.bson.BSONAggregationFramework.PipelineOperator

    Permalink

    Alias for BatchCommands.AggregationFramework.PipelineOperator

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from BSONCollection to any2stringadd[BSONCollection] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (BSONCollection, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from BSONCollection to ArrowAssoc[BSONCollection] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. val BatchCommands: BSONBatchCommands.type

    Permalink
    Definition Classes
    BSONCollectionGenericCollection
  7. object ImplicitlyDocumentProducer

    Permalink
    Definition Classes
    ImplicitCommandHelpers
  8. object Mongo26WriteCommand

    Permalink
    Attributes
    protected
    Definition Classes
    GenericCollection
  9. implicit def PackIdentityReader: Reader[Document]

    Permalink
    Definition Classes
    GenericCollection
  10. implicit def PackIdentityWriter: Writer[Document]

    Permalink
    Definition Classes
    GenericCollection
  11. def aggregate(firstOperator: PipelineOperator, otherOperators: List[PipelineOperator] = Nil, explain: Boolean = false, allowDiskUse: Boolean = false, bypassDocumentValidation: Boolean = false, readConcern: Option[ReadConcern] = None)(implicit ec: ExecutionContext): Future[commands.bson.BSONAggregationFramework.AggregationResult]

    Permalink

    Aggregates the matching documents.

    Aggregates the matching documents.

    import scala.concurrent.Future
    import scala.concurrent.ExecutionContext.Implicits.global
    
    import reactivemongo.bson._
    import reactivemongo.api.collections.bson.BSONCollection
    
    def populatedStates(cities: BSONCollection): Future[List[BSONDocument]] = {
      import cities.BatchCommands.AggregationFramework
      import AggregationFramework.{ Group, Match, SumField }
    
      cities.aggregate(Group(BSONString("$state"))(
        "totalPop" -> SumField("population")), List(
          Match(document("totalPop" ->
            document("$gte" -> 10000000L))))).map(_.documents)
    }
    firstOperator

    the first aggregation operator of the pipeline

    otherOperators

    the sequence of MongoDB aggregation operations

    explain

    if true indicates to return the information on the processing of the pipeline

    allowDiskUse

    if true enables writing to temporary files

    bypassDocumentValidation

    if true enables to bypass document validation during the operation

    readConcern

    the read concern

    Definition Classes
    GenericCollection
  12. def aggregateWith1[T](explain: Boolean = false, allowDiskUse: Boolean = false, bypassDocumentValidation: Boolean = false, readConcern: Option[ReadConcern] = None, readPreference: ReadPreference = ReadPreference.primary, batchSize: Option[Int] = None)(f: (AggregationFramework) ⇒ (PipelineOperator, List[PipelineOperator]))(implicit ec: ExecutionContext, reader: Reader[T], cf: CursorFlattener[Cursor], cp: CursorProducer[T]): ProducedCursor

    Permalink

    Aggregates the matching documents.

    Aggregates the matching documents.

    T

    The type of the result elements. An implicit Reader[T] typeclass for handling it has to be in the scope.

    explain

    if true indicates to return the information on the processing of the pipeline

    allowDiskUse

    if true enables writing to temporary files

    bypassDocumentValidation

    if true enables to bypass document validation during the operation

    readConcern

    the read concern

    readPreference

    the read preference for the result (default: primary)

    batchSize

    the batch size (for the aggregation cursor; if None use the default one)

    f

    $aggregationPipelineFunction

    reader

    the result reader

    cf

    the cursor flattener (by default use the builtin one)

    Definition Classes
    GenericCollection
  13. def aggregatorContext[T](firstOperator: PipelineOperator, otherOperators: List[PipelineOperator] = Nil, explain: Boolean = false, allowDiskUse: Boolean = false, bypassDocumentValidation: Boolean = false, readConcern: Option[ReadConcern] = None, readPreference: ReadPreference = ReadPreference.primary, batchSize: Option[Int] = None)(implicit reader: Reader[T]): AggregatorContext[T]

    Permalink

    Aggregates the matching documents.

    Aggregates the matching documents.

    T

    The type of the result elements. An implicit Reader[T] typeclass for handling it has to be in the scope.

    firstOperator

    the first aggregation operator of the pipeline

    otherOperators

    the sequence of MongoDB aggregation operations

    explain

    if true indicates to return the information on the processing of the pipeline

    allowDiskUse

    if true enables writing to temporary files

    bypassDocumentValidation

    if true enables to bypass document validation during the operation

    readConcern

    the read concern

    readPreference

    the read preference for the result

    reader

    the result reader

    Definition Classes
    GenericCollection
  14. def as[C <: Collection](failoverStrategy: FailoverStrategy = failoverStrategy)(implicit producer: CollectionProducer[C] = ...): C

    Permalink

    Gets another implementation of this collection.

    Gets another implementation of this collection. An implicit CollectionProducer[C] must be present in the scope, or it will be the default implementation (reactivemongo.api.collections.bson.BSONCollection).

    failoverStrategy

    the failover strategy to override the default one

    Definition Classes
    Collection
  15. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  16. def bulkInsert(documents: Stream[Document], ordered: Boolean, writeConcern: WriteConcern = defaultWriteConcern, bulkSize: Int, bulkByteSize: Int)(implicit ec: ExecutionContext): Future[MultiBulkWriteResult]

    Permalink
    Definition Classes
    GenericCollection
  17. def bulkInsert(documents: Stream[Document], ordered: Boolean, writeConcern: WriteConcern)(implicit ec: ExecutionContext): Future[MultiBulkWriteResult]

    Permalink
    Definition Classes
    GenericCollection
  18. def bulkInsert(documents: Stream[Document], ordered: Boolean)(implicit ec: ExecutionContext): Future[MultiBulkWriteResult]

    Permalink
    Definition Classes
    GenericCollection
  19. def bulkInsert(ordered: Boolean, writeConcern: WriteConcern, bulkSize: Int, bulkByteSize: Int)(documents: ImplicitlyDocumentProducer*)(implicit ec: ExecutionContext): Future[MultiBulkWriteResult]

    Permalink
    Definition Classes
    GenericCollection
  20. def bulkInsert(ordered: Boolean, writeConcern: WriteConcern)(documents: ImplicitlyDocumentProducer*)(implicit ec: ExecutionContext): Future[MultiBulkWriteResult]

    Permalink
    Definition Classes
    GenericCollection
  21. def bulkInsert(ordered: Boolean)(documents: ImplicitlyDocumentProducer*)(implicit ec: ExecutionContext): Future[MultiBulkWriteResult]

    Permalink
    Definition Classes
    GenericCollection
  22. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. def convertToCapped(size: Long, maxDocuments: Option[Int])(implicit ec: ExecutionContext): Future[Unit]

    Permalink

    Converts this collection to a capped one.

    Converts this collection to a capped one.

    size

    the size of the collection (number of bytes)

    maxDocuments

    the maximum number of documents this capped collection can contain

    Definition Classes
    CollectionMetaCommands
  24. def count[H](selector: Option[Document] = None, limit: Int = 0, skip: Int = 0, hint: Option[H] = None)(implicit h: (H) ⇒ commands.bson.BSONCountCommand.Hint, ec: ExecutionContext): Future[Int]

    Permalink

    Counts the matching documents.

    Counts the matching documents.

    H

    The type of hint. An implicit H => Hint conversion has to be in the scope.

    selector

    the document selector (default: None to count all)

    limit

    the maximum number of matching documents to count

    skip

    the number of matching documents to skip before counting

    hint

    the index to use (either the index name or the index document)

    Definition Classes
    GenericCollection
    See also

    MongoDB documentation

  25. def create(autoIndexId: Boolean = true)(implicit ec: ExecutionContext): Future[Unit]

    Permalink

    Creates this collection.

    Creates this collection.

    The returned future will be completed with an error if this collection already exists.

    autoIndexId

    If true should automatically add an index on the _id field. By default, regular collections will have an indexed _id field, in contrast to capped collections. This MongoDB option is deprecated and will be removed in a future release.

    Definition Classes
    CollectionMetaCommands
  26. def createCapped(size: Long, maxDocuments: Option[Int], autoIndexId: Boolean = false)(implicit ec: ExecutionContext): Future[Unit]

    Permalink

    Creates this collection as a capped one.

    Creates this collection as a capped one.

    The returned future will be completed with an error if this collection already exists.

    size

    the size of the collection (number of bytes)

    maxDocuments

    the maximum number of documents this capped collection can contain

    autoIndexId

    If true should automatically add an index on the _id field. By default, regular collections will have an indexed _id field, in contrast to capped collections. This MongoDB option is deprecated and will be removed in a future release.

    Definition Classes
    CollectionMetaCommands
  27. val db: DB

    Permalink

    The database which this collection belong to.

    The database which this collection belong to.

    Definition Classes
    BSONCollectionCollection
  28. def distinct[T, M[_] <: Iterable[_]](key: String, selector: Option[Document] = None, readConcern: ReadConcern = ReadConcern.Local)(implicit reader: NarrowValueReader[T], ec: ExecutionContext, cbf: CanBuildFrom[M[_], T, M[T]]): Future[M[T]]

    Permalink

    Returns the distinct values for a specified field across a single collection.

    Returns the distinct values for a specified field across a single collection.

    T

    the element type of the distinct values

    M

    the container, that must be a scala.collection.Iterable

    key

    the field for which to return distinct values

    selector

    the document selector, that specifies the documents from which to retrieve the distinct values.

    readConcern

    the read concern

    val distinctStates = collection.distinct[String, Set]("state")
    Definition Classes
    GenericCollection
  29. def drop(failIfNotFound: Boolean)(implicit ec: ExecutionContext): Future[Boolean]

    Permalink

    Drops this collection.

    Drops this collection.

    If the collection existed and is successfully dropped, the returned future will be completed with true.

    If failIfNotFound is false and the collection doesn't exist, the returned future will be completed with false.

    Otherwise in case, the future will be completed with the encountered error.

    Definition Classes
    CollectionMetaCommands
  30. def ensuring(cond: (BSONCollection) ⇒ Boolean, msg: ⇒ Any): BSONCollection

    Permalink
    Implicit information
    This member is added by an implicit conversion from BSONCollection to Ensuring[BSONCollection] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  31. def ensuring(cond: (BSONCollection) ⇒ Boolean): BSONCollection

    Permalink
    Implicit information
    This member is added by an implicit conversion from BSONCollection to Ensuring[BSONCollection] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  32. def ensuring(cond: Boolean, msg: ⇒ Any): BSONCollection

    Permalink
    Implicit information
    This member is added by an implicit conversion from BSONCollection to Ensuring[BSONCollection] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  33. def ensuring(cond: Boolean): BSONCollection

    Permalink
    Implicit information
    This member is added by an implicit conversion from BSONCollection to Ensuring[BSONCollection] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  34. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  35. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  36. val failoverStrategy: FailoverStrategy

    Permalink

    The default failover strategy for the methods of this collection.

    The default failover strategy for the methods of this collection.

    Definition Classes
    BSONCollectionGenericCollectionCollection
  37. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  38. def find[S, J](selector: S, projection: J)(implicit swriter: Writer[S], pwriter: Writer[J]): GenericQueryBuilder[pack.type]

    Permalink

    Finds the documents matching the given criteria (selector), with the projection applied.

    Finds the documents matching the given criteria (selector), with the projection applied.

    S

    The type of the selector. An implicit Writer[S] typeclass for handling it has to be in the scope.

    selector

    the document selector

    projection

    the projection document to select only a subset of each matching documents

    swriter

    the writer for the selector

    pwriter

    the writer for the projection

    returns

    A GenericQueryBuilder that you can use to to customize the query. You can obtain a cursor by calling the method reactivemongo.api.Cursor on this query builder.

    Definition Classes
    GenericCollection
    See also

    MongoDB documentation

  39. def find[S](selector: S)(implicit swriter: Writer[S]): GenericQueryBuilder[pack.type]

    Permalink

    Finds the documents matching the given criteria (selector).

    Finds the documents matching the given criteria (selector).

    S

    The type of the selector. An implicit Writer[S] typeclass for handling it has to be in the scope.

    selector

    the document selector

    swriter

    the writer for the selector

    returns

    A GenericQueryBuilder that you can use to to customize the query. You can obtain a cursor by calling the method reactivemongo.api.Cursor on this query builder.

    Definition Classes
    GenericCollection
    See also

    MongoDB documentation

  40. def findAndModify[S](selector: S, modifier: commands.bson.BSONFindAndModifyCommand.Modify, sort: Option[Document] = None, fields: Option[Document] = None)(implicit swriter: Writer[S], ec: ExecutionContext): Future[commands.bson.BSONFindAndModifyCommand.FindAndModifyResult]

    Permalink

    Applies a findAndModify operation.

    Applies a findAndModify operation. See findAndUpdate and findAndRemove convenient functions.

    val updateOp = collection.updateModifier(
      BSONDocument("$set" -> BSONDocument("age" -> 35)))
    
    val personBeforeUpdate: Future[Option[Person]] =
      collection.findAndModify(BSONDocument("name" -> "Joline"), updateOp).
      map(_.result[Person])
    
    val removedPerson: Future[Option[Person]] = collection.findAndModify(
      BSONDocument("name" -> "Jack"), collection.removeModifier).
      map(_.result[Person])
    selector

    the document selector

    modifier

    the modify operator to be applied

    sort

    the document indicating the sort criteria (default: None)

    fields

    the projection fields

    swriter

    the writer for the selector

    Definition Classes
    GenericCollection
  41. def findAndRemove[S](selector: S, sort: Option[Document] = None, fields: Option[Document] = None)(implicit swriter: Writer[S], ec: ExecutionContext): Future[commands.bson.BSONFindAndModifyCommand.FindAndModifyResult]

    Permalink

    Finds some matching document, and removes it (using findAndModify).

    Finds some matching document, and removes it (using findAndModify).

    val removed: Future[Person] = collection.findAndRemove(
      BSONDocument("name" -> "Foo")).map(_.result[Person])
    S

    The type of the selector. An implicit Writer[S] typeclass for handling it has to be in the scope.

    selector

    the document selector

    sort

    the document indicating the sort criteria

    fields

    the projection fields

    swriter

    the writer for the selector

    Definition Classes
    GenericCollection
  42. def findAndUpdate[S, T](selector: S, update: T, fetchNewObject: Boolean = false, upsert: Boolean = false, sort: Option[Document] = None, fields: Option[Document] = None)(implicit swriter: Writer[S], writer: Writer[T], ec: ExecutionContext): Future[commands.bson.BSONFindAndModifyCommand.FindAndModifyResult]

    Permalink

    Finds some matching document, and updates it (using findAndModify).

    Finds some matching document, and updates it (using findAndModify).

    val person: Future[BSONDocument] = collection.findAndUpdate(
      BSONDocument("name" -> "James"),
      BSONDocument("$set" -> BSONDocument("age" -> 17)),
      fetchNewObject = true) // on success, return the update document:
                             // { "age": 17 }
    selector

    the document selector

    update

    the update to be applied

    fetchNewObject

    the command result must be the new object instead of the old one.

    upsert

    if true, creates a new document if no document is matching, otherwise if at least one document matches, an update is applied

    sort

    the document indicating the sort criteria (default: None)

    fields

    the projection fields

    swriter

    the writer for the selector

    writer

    writerParam

    Definition Classes
    GenericCollection
  43. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from BSONCollection to StringFormat[BSONCollection] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  44. def fullCollectionName: String

    Permalink

    Gets the full qualified name of this collection.

    Gets the full qualified name of this collection.

    Definition Classes
    Collection
  45. def genericQueryBuilder: BSONQueryBuilder

    Permalink
    Definition Classes
    BSONCollectionGenericCollection
  46. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  47. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  48. def indexesManager(implicit ec: ExecutionContext): CollectionIndexesManager

    Permalink

    Returns an index manager for this collection.

    Returns an index manager for this collection.

    Definition Classes
    CollectionMetaCommands
  49. def insert[T](document: T, writeConcern: WriteConcern = defaultWriteConcern)(implicit writer: Writer[T], ec: ExecutionContext): Future[WriteResult]

    Permalink

    Inserts a document into the collection and waits for the reactivemongo.api.commands.WriteResult.

    Inserts a document into the collection and waits for the reactivemongo.api.commands.WriteResult.

    T

    The type of the document to insert. An implicit Writer[T] typeclass for handling it has to be in the scope.

    document

    the document to insert

    writeConcern

    the writer concern to be used

    writer

    the writer to create the document to be inserted

    returns

    a future reactivemongo.api.commands.WriteResult that can be used to check whether the insertion was successful

    Definition Classes
    GenericCollection
  50. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  51. val name: String

    Permalink

    The name of the collection.

    The name of the collection.

    Definition Classes
    BSONCollectionCollection
  52. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  53. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  54. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  55. val pack: BSONSerializationPack.type

    Permalink
  56. def productIterator: Iterator[Any]

    Permalink
    Definition Classes
    Product
  57. def productPrefix: String

    Permalink
    Definition Classes
    Product
  58. val readPreference: ReadPreference

    Permalink
    Definition Classes
    BSONCollectionGenericCollection
  59. def remove[S](selector: S, writeConcern: WriteConcern = defaultWriteConcern, firstMatchOnly: Boolean = false)(implicit swriter: Writer[S], ec: ExecutionContext): Future[WriteResult]

    Permalink

    Removes the matching document(s).

    Removes the matching document(s).

    S

    The type of the selector. An implicit Writer[S] typeclass for handling it has to be in the scope.

    selector

    the document selector

    writeConcern

    the writer concern to be used

    firstMatchOnly

    states whether only the first matched documents has to be removed from this collection.

    swriter

    the writer for the selector

    returns

    a future reactivemongo.api.commands.WriteResult that can be used to check whether the removal was successful

    Definition Classes
    GenericCollection
  60. lazy val removeModifier: commands.bson.BSONFindAndModifyCommand.Remove.type

    Permalink

    Returns a removal modifier, to be used with findAndModify.

    Returns a removal modifier, to be used with findAndModify.

    Definition Classes
    GenericCollection
  61. def rename(to: String, dropExisting: Boolean = false)(implicit ec: ExecutionContext): Future[Unit]

    Permalink

    Renames this collection.

    Renames this collection.

    to

    the new name of this collection

    dropExisting

    if a collection of name to already exists, then drops that collection before renaming this one

    returns

    a failure if the dropExisting option is false and the target collection already exists

    Definition Classes
    CollectionMetaCommands
  62. def runCommand[C <: CollectionCommand](command: C)(implicit writer: Writer[ResolvedCollectionCommand[C]]): CursorFetcher[pack.type, Cursor]

    Permalink
  63. def runCommand[R, C <: CollectionCommand with CommandWithResult[R]](command: C with CommandWithResult[R], readPreference: ReadPreference)(implicit writer: Writer[ResolvedCollectionCommand[C]], reader: Reader[R], ec: ExecutionContext): Future[R]

    Permalink
  64. def runValueCommand[A <: AnyVal, R <: BoxedAnyVal[A], C <: CollectionCommand with CommandWithResult[R]](command: C with CommandWithResult[R with BoxedAnyVal[A]], rp: ReadPreference)(implicit writer: Writer[ResolvedCollectionCommand[C]], reader: Reader[R], ec: ExecutionContext): Future[A]

    Permalink
  65. def runWithResponse[R, C <: CollectionCommand with CommandWithResult[R]](command: C with CommandWithResult[R], readPreference: ReadPreference)(implicit writer: Writer[ResolvedCollectionCommand[C]], reader: Reader[R], ec: ExecutionContext): Future[ResponseResult[R]]

    Permalink
  66. def runner: CommandWithPackRunner[pack.type]

    Permalink
  67. def sibling[C <: Collection](name: String, failoverStrategy: FailoverStrategy = failoverStrategy)(implicit producer: CollectionProducer[C] = ...): C

    Permalink

    Gets another collection in the current database.

    Gets another collection in the current database. An implicit CollectionProducer[C] must be present in the scope, or it will be the default implementation (reactivemongo.api.collections.bson.BSONCollection).

    name

    the name of another collection

    failoverStrategy

    the failover strategy to override the default one

    Definition Classes
    Collection
  68. def stats(scale: Int)(implicit ec: ExecutionContext): Future[CollStatsResult]

    Permalink

    Returns various information about this collection.

    Returns various information about this collection.

    scale

    the scale factor (for example, to get all the sizes in kilobytes)

    Definition Classes
    CollectionMetaCommands
  69. def stats()(implicit ec: ExecutionContext): Future[CollStatsResult]

    Permalink

    Returns various information about this collection.

    Returns various information about this collection.

    Definition Classes
    CollectionMetaCommands
  70. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  71. lazy val toString: String

    Permalink
    Definition Classes
    BSONCollection → AnyRef → Any
  72. def update[S, T](selector: S, update: T, writeConcern: WriteConcern = defaultWriteConcern, upsert: Boolean = false, multi: Boolean = false)(implicit swriter: Writer[S], writer: Writer[T], ec: ExecutionContext): Future[UpdateWriteResult]

    Permalink

    Updates one or more documents matching the given selector with the given modifier or update object.

    Updates one or more documents matching the given selector with the given modifier or update object.

    S

    The type of the selector. An implicit Writer[S] typeclass for handling it has to be in the scope.

    T

    The type of the modifier or update object. An implicit Writer[T] typeclass for handling it has to be in the scope.

    selector

    the selector object, for finding the documents to update.

    update

    the modifier object (with special keys like $set) or replacement object.

    writeConcern

    the writer concern to be used

    upsert

    if true, creates a new document if no document is matching, otherwise if at least one document matches, an update is applied (defaults: false)

    multi

    states whether the update may be done on all the matching documents (default: false)

    swriter

    the writer for the selector

    writer

    the writer to create the document

    returns

    a future reactivemongo.api.commands.WriteResult that can be used to check whether the insertion was successful

    Definition Classes
    GenericCollection
  73. def updateModifier[U](update: U, fetchNewObject: Boolean = false, upsert: Boolean = false)(implicit updateWriter: Writer[U]): commands.bson.BSONFindAndModifyCommand.Update

    Permalink

    Returns an update modifier, to be used with findAndModify.

    Returns an update modifier, to be used with findAndModify.

    update

    the update to be applied

    fetchNewObject

    the command result must be the new object instead of the old one.

    upsert

    if true, creates a new document if no document is matching, otherwise if at least one document matches, an update is applied

    Definition Classes
    GenericCollection
  74. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  75. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  76. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  77. def watchFailure[T](future: ⇒ Future[T]): Future[T]

    Permalink
    Attributes
    protected
    Definition Classes
    GenericCollection
  78. def withReadPreference(pref: ReadPreference): BSONCollection

    Permalink

    Returns a new reference to the same collection, with the given read preference.

    Returns a new reference to the same collection, with the given read preference.

    Definition Classes
    BSONCollectionGenericCollection
  79. def [B](y: B): (BSONCollection, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from BSONCollection to ArrowAssoc[BSONCollection] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Deprecated Value Members

  1. def aggregate[T](firstOperator: PipelineOperator, otherOperators: List[PipelineOperator], cursor: Option[commands.bson.BSONAggregationFramework.Cursor], explain: Boolean, allowDiskUse: Boolean, bypassDocumentValidation: Boolean, readConcern: Option[ReadConcern], readPreference: ReadPreference)(implicit ec: ExecutionContext, reader: Reader[T], cf: CursorFlattener[Cursor]): Cursor[T]

    Permalink

    Aggregates the matching documents.

    Aggregates the matching documents.

    import scala.concurrent.Future
    import scala.concurrent.ExecutionContext.Implicits.global
    
    import reactivemongo.bson._
    import reactivemongo.api.Cursor
    import reactivemongo.api.collections.bson.BSONCollection
    
    def populatedStates(cities: BSONCollection): Future[Cursor[BSONDocument]] =
      {
        import cities.BatchCommands.AggregationFramework
        import AggregationFramework.{
          Cursor => AggCursor, Group, Match, SumField
        }
    
        val cursor = AggCursor(batchSize = 1) // initial batch size
    
        cities.aggregate1[BSONDocument](Group(BSONString("$state"))(
          "totalPop" -> SumField("population")), List(
            Match(document("totalPop" ->
              document("$gte" -> 10000000L)))),
          cursor)
      }
    T

    The type of the result elements. An implicit Reader[T] typeclass for handling it has to be in the scope.

    firstOperator

    the first aggregation operator of the pipeline

    otherOperators

    the sequence of MongoDB aggregation operations

    cursor

    aggregation cursor option (optional)

    explain

    if true indicates to return the information on the processing of the pipeline

    allowDiskUse

    if true enables writing to temporary files

    bypassDocumentValidation

    if true enables to bypass document validation during the operation

    readConcern

    the read concern

    readPreference

    the read preference for the result

    reader

    the result reader

    cf

    the cursor flattener (by default use the builtin one)

    Definition Classes
    GenericCollection
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12.3) Use aggregatorContext

  2. def aggregate1[T](firstOperator: PipelineOperator, otherOperators: List[PipelineOperator], explain: Boolean = false, allowDiskUse: Boolean = false, bypassDocumentValidation: Boolean = false, readConcern: Option[ReadConcern] = None, readPreference: ReadPreference = ReadPreference.primary, batchSize: Option[Int] = None)(implicit ec: ExecutionContext, reader: Reader[T], cf: CursorFlattener[Cursor]): Cursor[T]

    Permalink

    Aggregates the matching documents.

    Aggregates the matching documents.

    T

    The type of the result elements. An implicit Reader[T] typeclass for handling it has to be in the scope.

    firstOperator

    the first aggregation operator of the pipeline

    otherOperators

    the sequence of MongoDB aggregation operations

    explain

    if true indicates to return the information on the processing of the pipeline

    allowDiskUse

    if true enables writing to temporary files

    bypassDocumentValidation

    if true enables to bypass document validation during the operation

    readConcern

    the read concern

    readPreference

    the read preference for the result

    batchSize

    the batch size (for the aggregation cursor; if None use the default one)

    reader

    the result reader

    cf

    the cursor flattener (by default use the builtin one)

    Definition Classes
    GenericCollection
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12.3) Use aggregatorContext

  3. def aggregateWith[T](explain: Boolean = false, allowDiskUse: Boolean = false, bypassDocumentValidation: Boolean = false, readConcern: Option[ReadConcern] = None, readPreference: ReadPreference = ReadPreference.primary, batchSize: Option[Int] = None)(f: (AggregationFramework) ⇒ (PipelineOperator, List[PipelineOperator]))(implicit ec: ExecutionContext, reader: Reader[T], cf: CursorFlattener[Cursor]): Cursor[T]

    Permalink

    Aggregates the matching documents.

    Aggregates the matching documents.

    T

    The type of the result elements. An implicit Reader[T] typeclass for handling it has to be in the scope.

    explain

    if true indicates to return the information on the processing of the pipeline

    allowDiskUse

    if true enables writing to temporary files

    bypassDocumentValidation

    if true enables to bypass document validation during the operation

    readConcern

    the read concern

    readPreference

    the read preference for the result (default: primary)

    batchSize

    the batch size (for the aggregation cursor; if None use the default one)

    f

    $aggregationPipelineFunction

    reader

    the result reader

    cf

    the cursor flattener (by default use the builtin one)

    Definition Classes
    GenericCollection
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12.3) Use aggregateWith1

  4. def canEqual(that: Any): Boolean

    Permalink
    Definition Classes
    BSONCollection → Equals
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12-RC2) No longer a case class

  5. def copy(db: DB = this.db, name: String = this.name, failoverStrategy: FailoverStrategy = this.failoverStrategy): BSONCollection

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12-RC2) No longer a case class

  6. def drop()(implicit ec: ExecutionContext): Future[Unit]

    Permalink

    Drops this collection.

    Drops this collection.

    The returned future will be completed with an error if this collection does not exist.

    Definition Classes
    CollectionMetaCommands
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12.0) Use drop(Boolean)

  7. def emptyCapped()(implicit ec: ExecutionContext): Future[Unit]

    Permalink

    If this collection is capped, removes all the documents it contains.

    If this collection is capped, removes all the documents it contains.

    Deprecated because it became an internal command, unavailable by default.

    Definition Classes
    CollectionMetaCommands
    Annotations
    @deprecated
    Deprecated

    (Since version 0.9) Deprecated because emptyCapped became an internal command, unavailable by default.

  8. val productArity: Int

    Permalink
    Definition Classes
    BSONCollection → Product
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12-RC2) No longer a case class

  9. def productElement(n: Int): Any

    Permalink
    Definition Classes
    BSONCollection → Product
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12-RC2) No longer a case class

  10. def runCommand[R, C <: CollectionCommand with CommandWithResult[R]](command: C with CommandWithResult[R])(implicit writer: Writer[ResolvedCollectionCommand[C]], reader: Reader[R], ec: ExecutionContext): Future[R]

    Permalink
    Definition Classes
    GenericCollectionWithCommands
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12-RC5) Use the alternative with ReadPreference

  11. def runValueCommand[A <: AnyVal, R <: BoxedAnyVal[A], C <: CollectionCommand with CommandWithResult[R]](command: C with CommandWithResult[R with BoxedAnyVal[A]])(implicit writer: Writer[ResolvedCollectionCommand[C]], reader: Reader[R], ec: ExecutionContext): Future[A]

    Permalink
    Definition Classes
    GenericCollectionWithCommands
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12-RC5) Use the alternative with ReadPreference

  12. def runWithResponse[R, C <: CollectionCommand with CommandWithResult[R]](command: C with CommandWithResult[R])(implicit writer: Writer[ResolvedCollectionCommand[C]], reader: Reader[R], ec: ExecutionContext): Future[ResponseResult[R]]

    Permalink
    Definition Classes
    GenericCollectionWithCommands
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12-RC5) Use the alternative with ReadPreference

  13. def sister[C <: Collection](name: String, failoverStrategy: FailoverStrategy = failoverStrategy)(implicit producer: CollectionProducer[C] = ...): C

    Permalink

    Gets another collection in the current database.

    Gets another collection in the current database. An implicit CollectionProducer[C] must be present in the scope, or it will be the default implementation (reactivemongo.api.collections.bson.BSONCollection).

    name

    the name of another collection

    failoverStrategy

    the failover strategy to override the default one

    Definition Classes
    Collection
    Annotations
    @deprecated
    Deprecated

    (Since version 0.10) Consider using sibling instead

  14. def uncheckedInsert[T](document: T)(implicit writer: Writer[T]): Unit

    Permalink

    Inserts a document into the collection without writeConcern.

    Inserts a document into the collection without writeConcern.

    Please note that you cannot be sure that the document has been effectively written and when (hence the Unit return type).

    T

    the type of the document to insert. An implicit Writer[T] typeclass for handling it has to be in the scope.

    document

    the document to insert.

    Definition Classes
    GenericCollection
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12.0) Use insert

  15. def uncheckedRemove[T](query: T, firstMatchOnly: Boolean = false)(implicit writer: Writer[T], ec: ExecutionContext): Unit

    Permalink

    Remove the matched document(s) from the collection without writeConcern.

    Remove the matched document(s) from the collection without writeConcern.

    Please note that you cannot be sure that the matched documents have been effectively removed and when (hence the Unit return type).

    T

    the type of the selector of documents to remove. An implicit Writer[T] typeclass for handling it has to be in the scope.

    query

    the selector of documents to remove.

    firstMatchOnly

    states whether only the first matched documents has to be removed from this collection.

    Definition Classes
    GenericCollection
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12.0) Use remove

  16. def uncheckedUpdate[S, U](selector: S, update: U, upsert: Boolean = false, multi: Boolean = false)(implicit selectorWriter: Writer[S], updateWriter: Writer[U]): Unit

    Permalink

    Updates one or more documents matching the given selector with the given modifier or update object.

    Updates one or more documents matching the given selector with the given modifier or update object.

    Please note that you cannot be sure that the matched documents have been effectively updated and when (hence the Unit return type).

    S

    the type of the selector object. An implicit Writer[S] typeclass for handling it has to be in the scope.

    U

    the type of the modifier or update object. An implicit Writer[U] typeclass for handling it has to be in the scope.

    selector

    the selector object, for finding the documents to update.

    update

    the modifier object (with special keys like $set) or replacement object.

    upsert

    states whether the update objet should be inserted if no match found. Defaults to false.

    multi

    states whether the update may be done on all the matching documents.

    Definition Classes
    GenericCollection
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12.0) Use update

Inherited from Serializable

Inherited from Serializable

Inherited from CollectionMetaCommands

Inherited from Collection

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from BSONCollection to any2stringadd[BSONCollection]

Inherited by implicit conversion StringFormat from BSONCollection to StringFormat[BSONCollection]

Inherited by implicit conversion Ensuring from BSONCollection to Ensuring[BSONCollection]

Inherited by implicit conversion ArrowAssoc from BSONCollection to ArrowAssoc[BSONCollection]

Ungrouped