acolyte

reactivemongo

package reactivemongo

Visibility
  1. Public
  2. All

Type Members

  1. case class BDoc(underlying: BSONDocument) extends Product with Serializable

    BSONDocument wrapper for pattern matching

  2. sealed trait ConnectionHandler extends AnyRef

    Connection handler.

  3. trait DriverManager[T] extends AnyRef

    Driver manager

  4. trait PreparedResponse extends AnyRef

    Response prepared for Mongo request executed with Acolyte driver.

  5. case class Property(name: String) extends Product with Serializable

    Extractor for BSON property, allowing partial and un-ordered match by name.

    Extractor for BSON property, allowing partial and un-ordered match by name. Rich match syntax ~(Property(name), ...) requires use of http://acolyte.eu.org/scalac-plugin.html

    import reactivemongo.bson.{ BSONInteger, BSONString }
    import acolyte.reactivemongo.{ Request, SimpleBody, Property, & }
    
    val EmailXtr = Property("email") // Without scalac plugin
    
    request match {
      case Request("db.col", SimpleBody(~(Property("email"), BSONString(e)))) =>
        // Request on db.col with an "email" string property,
        // anywhere in properties (possibly with others which are ignored there),
        // with `e` bound to extracted string value.
        resultA
    
      case Request("db.col", SimpleBody(EmailXtr(BSONString(e)))) =>
        // Request on db.col with an "email" string property,
        // anywhere in properties (possibly with others which are ignored there),
        // with `e` bound to extracted string value.
        resultB // similar to case resultA without scalac plugin
    
      case Request("db.col", SimpleBody(
        ~(Property("name"), BSONString("eman")))) =>
        // Request on db.col with an "name" string property with "eman" as value,
        // anywhere in properties (possibly with others which are ignored there).
        resultC
    
      case Request(colName, SimpleBody(
        ~(Property("age"), BSONInteger(age)) &
        ~(Property("email"), BSONString(v)))) =>
        // Request on any collection, with an "age" integer property
        // and an "email" string property, possibly not in this order.
        resultD
    
      case Request(colName, SimpleBody(
        ~(Property("age"), ValueDocument(
          ~(Property("$gt"), BSONInteger(minAge)))) &
        ~(Property("email"), BSONString("[email protected]")))) =>
        // Request on any collection, with an "age" property with itself
        // a operator property "$gt" having an integer value, and an "email"
        // property (at the same level as age), without order constraint.
        resultE
    
    }
    See also

    ValueDocument

    &

  6. sealed trait QueryHandler extends (Int, Request) ⇒ Option[Try[Response]]

    Query handler.

  7. trait QueryResponseMaker[T] extends (Int, T) ⇒ Option[Try[Response]]

    Creates a query response for given channel ID and result.

    Creates a query response for given channel ID and result.

    T

    Result type

  8. trait Request extends AnyRef

    Request executed against Mongo connection.

  9. trait WithCollection extends AnyRef

    Functions to work with a Mongo collection (provided DB functions).

  10. trait WithDB extends AnyRef

    Functions to work with Mongo DB (provided driver functions).

  11. trait WithDriver extends AnyRef

    Functions to work with driver.

  12. trait WithHandler extends AnyRef

    Functions to work with handler (provided driver functions).

  13. trait WithResult extends AnyRef

    Functions to work with result (provided collection functions).

  14. sealed trait WriteHandler extends (Int, WriteOp, Request) ⇒ Option[Try[Response]]

    Write handler.

  15. sealed trait WriteOp extends AnyRef

    Operator, along with request when writing.

  16. trait WriteResponseMaker[T] extends (Int, T) ⇒ Option[Try[Response]]

    Creates a write response for given channel ID and result.

    Creates a write response for given channel ID and result.

    T

    Result type

Value Members

  1. object &

    Meta-extractor, to combine extractor on BSON properties.

    Meta-extractor, to combine extractor on BSON properties.

    See also

    Property

    SimpleBody

  2. object AcolyteDSL extends WithDriver with WithDB with WithCollection with WithHandler with WithResult

    Acolyte DSL for ReactiveMongo.

  3. object ConnectionHandler

    Companion object for connection handler.

  4. object CountRequest

    Body extractor for Count request.

    Body extractor for Count request.

    See also

    SimpleBody

  5. object DeleteOp extends WriteOp with Product with Serializable

    Delete operator

  6. object DriverManager

    Driver manage companion.

  7. object InClause

    In clause extractor ($in with BSONArray; e.g.

    In clause extractor ($in with BSONArray; e.g. { '$in': [ ... ] })

  8. object InsertOp extends WriteOp with Product with Serializable

    Insert operator

  9. object MongoDB

  10. object QueryHandler

    Query handler companion.

  11. object QueryResponse

    Query response factory.

  12. object QueryResponseMaker

    Response maker companion.

  13. object Request

    Request companion

  14. object RequestBody

    Complete request body extractor; Matches body with many documents.

  15. object SimpleBody

    Body extractor for simple request, with only one document.

    Body extractor for simple request, with only one document. If there are more than one document, matching just ignore extra ones.

  16. object UpdateOp extends WriteOp with Product with Serializable

    Update operator

  17. object ValueDocument

    Extractor of properties for a document used a BSON value (when operator is used, e.g.

    Extractor of properties for a document used a BSON value (when operator is used, e.g. { 'age': { '$gt': 10 } }).

    See also

    Property

    Request

  18. object ValueList

    Extracts values of BSON array as list.

    Extracts values of BSON array as list.

    See also

    ValueDocument

  19. object WriteHandler

    Write handler companion.

  20. object WriteResponse

    Write response factory.

  21. object WriteResponseMaker

    Response maker companion.

Ungrouped