Package

reactivemongo

bson

Permalink

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
Visibility
  1. Public
  2. All

Type Members

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

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

    Permalink
    Definition Classes
    DefaultBSONHandlers
  3. class BSONBooleanLikeReader[B <: BSONValue] extends BSONReader[B, BSONBooleanLike]

    Permalink
    Definition Classes
    DefaultBSONHandlers
  4. type BSONElement = (String, BSONValue)

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

    Permalink
    Definition Classes
    DefaultBSONHandlers
  6. abstract class IdentityBSONConverter[T <: BSONValue] extends BSONReader[T, T] with BSONWriter[T, T]

    Permalink
    Definition Classes
    DefaultBSONHandlers

Value Members

  1. implicit object BSONArrayIdentity extends IdentityBSONConverter[BSONArray]

    Permalink
    Definition Classes
    DefaultBSONHandlers
  2. implicit object BSONBinaryHandler extends BSONHandler[BSONBinary, Array[Byte]]

    Permalink
    Definition Classes
    DefaultBSONHandlers
  3. implicit object BSONBinaryIdentity extends IdentityBSONConverter[BSONBinary]

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

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

    Permalink
    Definition Classes
    DefaultBSONHandlers
  6. implicit object BSONBooleanLikeWriter extends VariantBSONWriter[BSONBooleanLike, BSONValue]

    Permalink
    Definition Classes
    DefaultBSONHandlers
  7. implicit object BSONDateTimeHandler extends BSONHandler[BSONDateTime, Date]

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

    Permalink
    Definition Classes
    DefaultBSONHandlers
  9. implicit object BSONDocumentIdentity extends IdentityBSONConverter[BSONDocument] with BSONDocumentReader[BSONDocument] with BSONDocumentWriter[BSONDocument]

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    DefaultBSONHandlers
  17. implicit object BSONNullIdentity extends IdentityBSONConverter[BSONNull.type]

    Permalink
    Definition Classes
    DefaultBSONHandlers
  18. implicit object BSONNumberLikeWriter extends VariantBSONWriter[BSONNumberLike, BSONValue]

    Permalink
    Definition Classes
    DefaultBSONHandlers
  19. implicit object BSONObjectIDIdentity extends IdentityBSONConverter[BSONObjectID]

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

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

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

    Permalink
    Definition Classes
    DefaultBSONHandlers
  23. implicit object BSONUndefinedIdentity extends IdentityBSONConverter[BSONUndefined.type]

    Permalink
    Definition Classes
    DefaultBSONHandlers
  24. implicit object BSONValueIdentity extends IdentityBSONConverter[BSONValue]

    Permalink
    Definition Classes
    DefaultBSONHandlers
  25. object Macros

    Permalink

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

    Macros for generating BSONReader and BSONWriter 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

  26. def array(values: Producer[BSONValue]*): BSONArray

    Permalink
  27. def array: BSONArray

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

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

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

    Permalink
    Definition Classes
    DefaultBSONHandlers
  31. implicit def collectionToBSONArrayCollectionWriter[T, Repr](implicit arg0: (Repr) ⇒ Traversable[T], writer: BSONWriter[T, _ <: BSONValue]): VariantBSONWriter[Repr, BSONArray]

    Permalink
    Definition Classes
    DefaultBSONHandlers
  32. def document(elements: Producer[BSONElement]*): BSONDocument

    Permalink
  33. def document: BSONDocument

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

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

    Permalink
    Definition Classes
    DefaultBSONHandlers
  36. def generateId: BSONObjectID

    Permalink

Inherited from DefaultBSONHandlers

Inherited from AnyRef

Inherited from Any

Ungrouped