reactivemongo

bson

package bson

Linear Supertypes
DefaultBSONHandlers, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. bson
  2. DefaultBSONHandlers
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. case class BSONArray(stream: Stream[Try[BSONValue]]) extends BSONValue with Product with Serializable

    A BSONArray structure (BSON type 0x04).

    A BSONArray structure (BSON type 0x04).

    A BSONArray is a straightforward BSONDocument where keys are a sequence of positive integers.

    A BSONArray is basically a stream of tuples (String, BSONValue) where the first member is a string representation of an index. It is completely lazy. The stream it wraps is a Stream[Try[(String, BSONValue)]] since we cannot be sure that a not yet deserialized value will be processed without error.

  2. class BSONArrayCollectionReader[M[_], T] extends BSONReader[BSONArray, M[T]]

    Definition Classes
    DefaultBSONHandlers
  3. class BSONArrayCollectionWriter[T, Repr] extends VariantBSONWriter[Repr, BSONArray]

    Definition Classes
    DefaultBSONHandlers
  4. case class BSONBinary(value: ReadableBuffer, subtype: Subtype) extends BSONValue with Product with Serializable

    A BSON binary value.

    A BSON binary value.

    value

    The binary content.

    subtype

    The type of the binary content.

  5. case class BSONBoolean(value: Boolean) extends BSONValue with Product with Serializable

    BSON boolean value

  6. sealed trait BSONBooleanLike extends AnyRef

    A BSON value that can be seen as a boolean.

    A BSON value that can be seen as a boolean.

    Conversions:

    • number = 0 ~> false
    • number != 0 ~> true
    • boolean
    • undefined ~> false
    • null ~> false
  7. sealed trait BSONBooleanLikeClass[B <: BSONValue] extends BSONBooleanLike

  8. class BSONBooleanLikeReader[B <: BSONValue] extends BSONReader[B, BSONBooleanLike]

    Definition Classes
    DefaultBSONHandlers
  9. case class BSONDBPointer(value: String, id: Array[Byte]) extends BSONValue with Product with Serializable

    BSON DBPointer value.

  10. case class BSONDateTime(value: Long) extends BSONValue with Product with Serializable

    BSON date time value

  11. case class BSONDocument(stream: Stream[Try[BSONElement]]) extends BSONValue with Product with Serializable

    A BSONDocument structure (BSON type 0x03).

    A BSONDocument structure (BSON type 0x03).

    A BSONDocument is basically a stream of tuples (String, BSONValue). It is completely lazy. The stream it wraps is a Stream[Try[(String, BSONValue)]] since we cannot be sure that a not yet deserialized value will be processed without error.

  12. trait BSONDocumentReader[T] extends BSONReader[BSONDocument, T]

  13. trait BSONDocumentWriter[T] extends BSONWriter[T, BSONDocument]

  14. case class BSONDouble(value: Double) extends BSONValue with Product with Serializable

    A BSON Double.

  15. type BSONElement = (String, BSONValue)

  16. trait BSONHandler[B <: BSONValue, T] extends BSONReader[B, T] with BSONWriter[T, B]

  17. case class BSONInteger(value: Int) extends BSONValue with Product with Serializable

    BSON Integer value

  18. case class BSONJavaScript(value: String) extends BSONValue with Product with Serializable

    BSON JavaScript value.

    BSON JavaScript value.

    value

    The JavaScript source code.

  19. case class BSONJavaScriptWS(value: String) extends BSONValue with Product with Serializable

    BSON scoped JavaScript value.

    BSON scoped JavaScript value.

    value

    The JavaScript source code. TODO

  20. case class BSONLong(value: Long) extends BSONValue with Product with Serializable

    BSON Long value

  21. sealed trait BSONNumberLike extends AnyRef

    A BSON value that can be seen as a number.

    A BSON value that can be seen as a number.

    Conversions:

  22. sealed trait BSONNumberLikeClass[B <: BSONValue] extends BSONNumberLike

  23. class BSONNumberLikeReader[B <: BSONValue] extends BSONReader[B, BSONNumberLike]

    Definition Classes
    DefaultBSONHandlers
  24. class BSONObjectID extends BSONValue with Serializable

    BSON ObjectId value.

    BSON ObjectId value.

    Annotations
    @SerialVersionUID()
  25. trait BSONReader[B <: BSONValue, T] extends AnyRef

    A reader that produces an instance of T from a subtype of BSONValue.

  26. case class BSONRegex(value: String, flags: String) extends BSONValue with Product with Serializable

    BSON Regex value.

    BSON Regex value.

    flags

    Regex flags.

  27. case class BSONString(value: String) extends BSONValue with Product with Serializable

  28. case class BSONSymbol(value: String) extends BSONValue with Product with Serializable

    BSON Symbol value.

  29. case class BSONTimestamp(value: Long) extends BSONValue with Product with Serializable

    BSON Timestamp value.

    BSON Timestamp value. TODO

  30. trait BSONValue extends AnyRef

  31. trait BSONWriter[T, B <: BSONValue] extends AnyRef

    A writer that produces a subtype of BSONValue fron an instance of T.

  32. trait DefaultBSONHandlers extends AnyRef

  33. abstract class IdentityBSONConverter[T <: BSONValue] extends BSONReader[T, T] with BSONWriter[T, T]

    Definition Classes
    DefaultBSONHandlers
  34. sealed trait Producer[T] extends AnyRef

  35. sealed trait Subtype extends AnyRef

    Binary Subtype

  36. trait VariantBSONDocumentReader[+T] extends VariantBSONReader[BSONDocument, T]

  37. trait VariantBSONDocumentWriter[-T] extends VariantBSONWriter[T, BSONDocument]

  38. trait VariantBSONReader[-B <: BSONValue, +T] extends AnyRef

    A reader that produces an instance of T from a subtype of BSONValue.

  39. class VariantBSONReaderWrapper[B <: BSONValue, T] extends BSONReader[B, T]

  40. trait VariantBSONWriter[-T, +B <: BSONValue] extends AnyRef

    A writer that produces a subtype of BSONValue fron an instance of T.

  41. class VariantBSONWriterWrapper[T, B <: BSONValue] extends BSONWriter[T, B]

Value Members

  1. object BSON

  2. object BSONArray extends Serializable

  3. implicit object BSONArrayIdentity extends IdentityBSONConverter[BSONArray]

    Definition Classes
    DefaultBSONHandlers
  4. object BSONBinary extends Serializable

  5. implicit object BSONBinaryIdentity extends IdentityBSONConverter[BSONBinary]

    Definition Classes
    DefaultBSONHandlers
  6. implicit object BSONBooleanHandler extends BSONHandler[BSONBoolean, Boolean]

    Definition Classes
    DefaultBSONHandlers
  7. implicit object BSONBooleanIdentity extends IdentityBSONConverter[BSONBoolean]

    Definition Classes
    DefaultBSONHandlers
  8. object BSONBooleanLike

  9. implicit object BSONBooleanLikeWriter extends VariantBSONWriter[BSONBooleanLike, BSONValue]

    Definition Classes
    DefaultBSONHandlers
  10. implicit object BSONDateTimeIdentity extends IdentityBSONConverter[BSONDateTime]

    Definition Classes
    DefaultBSONHandlers
  11. object BSONDocument extends Serializable

  12. implicit object BSONDocumentIdentity extends IdentityBSONConverter[BSONDocument] with BSONDocumentReader[BSONDocument] with BSONDocumentWriter[BSONDocument]

    Definition Classes
    DefaultBSONHandlers
  13. implicit object BSONDoubleHandler extends BSONHandler[BSONDouble, Double]

    Definition Classes
    DefaultBSONHandlers
  14. implicit object BSONDoubleIdentity extends IdentityBSONConverter[BSONDouble]

    Definition Classes
    DefaultBSONHandlers
  15. implicit object BSONIntegerHandler extends BSONHandler[BSONInteger, Int]

    Definition Classes
    DefaultBSONHandlers
  16. implicit object BSONIntegerIdentity extends IdentityBSONConverter[BSONInteger]

    Definition Classes
    DefaultBSONHandlers
  17. implicit object BSONJavaScriptIdentity extends BSONReader[BSONJavaScript, BSONJavaScript] with BSONWriter[BSONJavaScript, BSONJavaScript]

    Definition Classes
    DefaultBSONHandlers
  18. implicit object BSONLongHandler extends BSONHandler[BSONLong, Long]

    Definition Classes
    DefaultBSONHandlers
  19. implicit object BSONLongIdentity extends IdentityBSONConverter[BSONLong]

    Definition Classes
    DefaultBSONHandlers
  20. object BSONMaxKey extends BSONValue

    BSON Max key value

  21. object BSONMinKey extends BSONValue

    BSON Min key value

  22. object BSONNull extends BSONValue with Product with Serializable

    BSON null value

  23. implicit object BSONNullIdentity extends IdentityBSONConverter[BSONNull.type]

    Definition Classes
    DefaultBSONHandlers
  24. object BSONNumberLike

  25. implicit object BSONNumberLikeWriter extends VariantBSONWriter[BSONNumberLike, BSONValue]

    Definition Classes
    DefaultBSONHandlers
  26. object BSONObjectID extends Serializable

  27. implicit object BSONObjectIDIdentity extends IdentityBSONConverter[BSONObjectID]

    Definition Classes
    DefaultBSONHandlers
  28. implicit object BSONRegexIdentity extends IdentityBSONConverter[BSONRegex]

    Definition Classes
    DefaultBSONHandlers
  29. implicit object BSONStringHandler extends BSONHandler[BSONString, String]

    Definition Classes
    DefaultBSONHandlers
  30. implicit object BSONStringIdentity extends IdentityBSONConverter[BSONString]

    Definition Classes
    DefaultBSONHandlers
  31. object BSONUndefined extends BSONValue with Product with Serializable

    BSON Undefined value

  32. implicit object BSONUndefinedIdentity extends IdentityBSONConverter[BSONUndefined.type]

    Definition Classes
    DefaultBSONHandlers
  33. object BSONValue

  34. implicit object BSONValueIdentity extends IdentityBSONConverter[BSONValue]

    Definition Classes
    DefaultBSONHandlers
  35. object DefaultBSONHandlers extends DefaultBSONHandlers

  36. object Macros

    Macros for generating BSONReader and SONWriter implementations for case at compile time.

    Macros for generating BSONReader and SONWriter implementations for case at compile time. Invoking these macros is equivalent to writing anonymous class implementations by hand.

    Example

    case class Person(name: String, surname: String)
    implicit val personHandler = Macros.handler[Person]

    Use reader to generate the BSONReader and writer for BSONWriter or handler for a class that extends both. Respective methods with 'Opts' appended take additional options in form of type parameters.

    The A type parameter defines case class that will be the basis for auto-generated implementation. Some other types with matching apply-unapply might work but behaviour is undefined. Since macros will match the apply-unapply pair you are free to overload these methods in the companion object.

    Fields in the case class get mapped into BSON properties with respective names and BSON handlers are pulled from implicit scope to (de)serialize them. In order to use custom types inside case classes just make sure appropriate handlers are in scope. Note that companion objects are searched too. For example if you have case class Foo(bar: Bar) and want to create a handler for it is enough to put an implicit handler for Bar in it's companion object. That handler might be macro generated or written by hand.

    Case classes can also be defined inside other classes, objects or traits but not inside functions(known limitation). In order to work you should have the case class in scope(where you call the macro) so you can refer to it by it's short name - without package. This is necessary because the generated implementations refer to it by the short name to support nested declarations. You can work around this with local imports.

    Example

    implicit val handler = {
    import some.package.Foo
    Macros.handler[Foo]
    }

    Option types are handled somewhat specially: a field of type Option[T] will only be appended to the document if it contains a value. Similarly if a document does not contain a value it will be read as None.

    Also supported neat trick are 'union types' that make for easy work with algebraic data types. See the UnionType option for more details.

    You can also create recursive structures by explicitly annotating types of the implicit handlers. (To let the compiler know they exist) Example

    sealed trait Tree
    case class Node(left: Tree, right: Tree) extends Tree
    case class Leaf(data: String) extends Tree
    
    object Tree {
      import Macros.Options._
      implicit val bson: Handler[Tree] = Macros.handlerOpts[Tree, UnionType[Node \/ Leaf]]
    }
    See also

    Macros.Options for specific options

  37. object Producer

  38. object Subtype

  39. implicit def bsonArrayToCollectionReader[M[_], T](implicit cbf: CanBuildFrom[M[_], T, M[T]], reader: BSONReader[_ <: BSONValue, T]): BSONReader[BSONArray, M[T]]

    Definition Classes
    DefaultBSONHandlers
  40. implicit def bsonBooleanLikeReader[B <: BSONValue]: BSONBooleanLikeReader[B]

    Definition Classes
    DefaultBSONHandlers
  41. implicit def bsonNumberLikeReader[B <: BSONValue]: BSONNumberLikeReader[B]

    Definition Classes
    DefaultBSONHandlers
  42. package buffer

  43. implicit def collectionToBSONArrayCollectionWriter[T, Repr](implicit arg0: (Repr) ⇒ Traversable[T], writer: BSONWriter[T, _ <: BSONValue]): VariantBSONWriter[Repr, BSONArray]

    Definition Classes
    DefaultBSONHandlers
  44. package exceptions

  45. implicit def findReader[T](implicit reader: VariantBSONReader[_ <: BSONValue, T]): BSONReader[_ <: BSONValue, T]

    Definition Classes
    DefaultBSONHandlers
  46. implicit def findWriter[T](implicit writer: VariantBSONWriter[T, _ <: BSONValue]): BSONWriter[T, _ <: BSONValue]

    Definition Classes
    DefaultBSONHandlers
  47. package utils

Inherited from DefaultBSONHandlers

Inherited from AnyRef

Inherited from Any

Ungrouped