Trait/Object

com.github.andriykuba.play.reactivemongo.shortcuts

Collection

Related Docs: object Collection | package shortcuts

Permalink

trait Collection extends CursorProducerEnchanceImplicit

Shortcut of the JSONCollection

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Collection
  2. CursorProducerEnchanceImplicit
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def collectionName: String

    Permalink

    Current collection name

Concrete Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def all(selector: JsObject, projection: Option[JsObject] = None, sort: Option[JsObject] = None)(implicit mongo: ReactiveMongoApi, ec: ExecutionContext): Future[List[JsObject]]

    Permalink

    Find all documents in one method call.

    Find all documents in one method call.

    selector

    the document selector

    returns

    a list of documents, wrapped in a Future

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def collection()(implicit mongo: ReactiveMongoApi, ec: ExecutionContext): Future[JSONCollection]

    Permalink

    Get collection in one method call

    Get collection in one method call

    returns

    the collection, wrapped in a Future

  8. def count()(implicit mongo: ReactiveMongoApi, ec: ExecutionContext): Future[Int]

    Permalink

    Shortcut for the collection.count() method

  9. def defineSubCollectionName(name: String): String

    Permalink

    Define the new collection name that is prefixed by this name.

    Define the new collection name that is prefixed by this name.

    For example this collection is named "application", then defineSubCollectionName("users") will return "application.users".

    name

    the name of the sub collection

    returns

    string that consists from the current collections name and passed name

  10. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def field[T](selector: JsObject, name: String)(implicit arg0: ClassTag[T], mongo: ReactiveMongoApi, ec: ExecutionContext): Future[T]

    Permalink

    Get a field from a single document.

    Get a field from a single document.

    Field type T is obligatory

    selector

    the document selector

    name

    the name of the field

    returns

    field value as T, wrapped in a Future

  13. def fieldJsValueOpt(selector: JsObject, name: String)(implicit mongo: ReactiveMongoApi, ec: ExecutionContext): Future[Option[JsValue]]

    Permalink

    Get a field from a single document.

    Get a field from a single document.

    The single document is taken by one method.

    selector

    the document selector

    name

    the name of the field

    returns

    optional field value in a JsValue form, wrapped in a Future

  14. def fieldOpt[T](selector: JsObject, name: String)(implicit arg0: ClassTag[T], mongo: ReactiveMongoApi, ec: ExecutionContext): Future[Option[T]]

    Permalink

    Get a field from a single document.

    Get a field from a single document.

    Field type T is obligatory

    selector

    the document selector

    name

    the name of the field

    returns

    optional field value as T, wrapped in a Future

  15. def fieldStringOrEmpty(selector: JsObject, name: String)(implicit mongo: ReactiveMongoApi, ec: ExecutionContext): Future[String]

    Permalink

    Get a string field from a single document or empty string if no document or file was found.

    Get a string field from a single document or empty string if no document or file was found.

    Empty string returned if no document was found or no field was found in the document.

    selector

    the document selector

    name

    the name of the field

    returns

    field value or empty string, wrapped in a Future

  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def find(selector: JsObject, projection: Option[JsObject] = None, sort: Option[JsObject] = None)(implicit mongo: ReactiveMongoApi, ec: ExecutionContext): Future[ProducedCursor]

    Permalink

    Find in one method call.

    Find in one method call. It's half-cooked method, that returns CursorProducer.

    For the JsObject ('s) result:

    Use the all(JsObject, JsObject) to find a set of document

    Use the one(JsObject, JsObject) to find one.

    selector

    the document selector

    returns

    CursorProducer, wrapped in a Future

  18. def first(selector: JsObject, projection: Option[JsObject] = None, sort: Option[JsObject] = None)(implicit mongo: ReactiveMongoApi, ec: ExecutionContext): Future[Option[JsObject]]

    Permalink

    The first document from the founded collection of documents.

    The first document from the founded collection of documents.

    selector

    the document selector

    returns

    first found document, optional, wrapped in a Future

  19. def fold[P](selector: JsObject, folder: Folder[P, JsObject], projection: Option[JsObject] = None, sort: Option[JsObject] = None)(implicit mongo: ReactiveMongoApi, ec: ExecutionContext): Future[P]

    Permalink

    Do foldWhile on the collection in one method call.

    Do foldWhile on the collection in one method call.

    selector

    the document selector

    folder

    the Folder object with start value and fold function

    returns

    final result of a fold function, wrapped in a Future

  20. def foldM[P](selector: JsObject, folder: FolderM[P, JsObject], projection: Option[JsObject] = None, sort: Option[JsObject] = None)(implicit mongo: ReactiveMongoApi, ec: ExecutionContext): Future[P]

    Permalink

    Do foldWhileM on the collection in one method call.

    Do foldWhileM on the collection in one method call.

    selector

    the document selector

    folder

    the FolderM object with start value and fold function

    returns

    final result of a fold function, wrapped in a Future

  21. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  23. def insert(document: JsObject)(implicit mongo: ReactiveMongoApi, ec: ExecutionContext): Future[WriteResult]

    Permalink

    Inserts a document into the collection and wait for the results.

    Inserts a document into the collection and wait for the results.

    The command is success if it was not fail.

    document

    the document to insert

    returns

    a WriteResult object, wrapped in Future

    See also

    WriteResult in the Reactivemongo documentation

  24. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  25. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  28. def one(selector: JsObject, projection: Option[JsObject] = None)(implicit mongo: ReactiveMongoApi, ec: ExecutionContext): Future[Option[JsObject]]

    Permalink

    Find zero or one document in one method call.

    Find zero or one document in one method call. Exception will be thrown if more than one document found.

    selector

    the document selector

    returns

    document, optional, wrapped in a Future

  29. def remove(selector: JsObject)(implicit mongo: ReactiveMongoApi, ec: ExecutionContext): Future[Boolean]

    Permalink

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

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

    selector

    the document selector

    returns

    true if document was removed or false if it was not found, wrapped in Future

  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  31. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  32. def update(selector: JsObject, update: JsObject, fetchNewObject: Boolean = false, upsert: Boolean = false)(implicit mongo: ReactiveMongoApi, ec: ExecutionContext): Future[Option[JsObject]]

    Permalink

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

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

    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

    returns

    a result document as JsObject, wrapped in Future

    See also

    findAndModify in the MongoDB documentation

  33. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped