package bson
import reactivemongo.api.bson._ // { "name": "Johny", "surname": "Doe", "age": 28, "months": [1, 2, 3] } document ++ ("name" -> "Johny") ++ ("surname" -> "Doe") ++ ("age" -> 28) ++ ("months" -> array(1, 2, 3)) // { "_id": generatedId, "name": "Jane", "surname": "Doe", "age": 28, // "months": [1, 2, 3], "details": { "salary": 12345, // "inventory": ["foo", 7.8, 0, false] } } document ++ ("_id" -> generateId, "name" -> "Jane", "surname" -> "Doe", "age" -> 28, "months" -> array(1, 2, 3), "details" -> document( "salary" -> 12345L, "inventory" -> array("foo", 7.8, 0L, false)))
- Alphabetic
- By Inheritance
- bson
- Utils
- Aliases
- DefaultBSONHandlers
- BSONIdentityHandlers
- BSONIdentityLowPriorityHandlers
- LowPriorityBSONHandlers
- LowerPriorityBSONHandlers
- LowPriorityBSONHandlersCompat
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Package Members
- package exceptions
Type Members
- final class BSONArray extends BSONValue
A
BSONArray
structure (BSON type0x04
).A
BSONArray
structure (BSON type0x04
).A
BSONArray
is a indexed sequence of BSONValue. - class BSONArrayCollectionReader[M[_], T] extends BSONReader[M[T]]
- Attributes
- protected
- Definition Classes
- LowPriorityBSONHandlers
- final class BSONBinary extends BSONValue
A BSON binary value.
- final class BSONBoolean extends BSONValue
BSON boolean value
- 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
- final class BSONDateTime extends BSONValue
BSON date time value
- final class BSONDecimal extends BSONValue
Value wrapper for a BSON 128-bit decimal.
- sealed abstract class BSONDocument extends BSONValue with ElementProducer with BSONDocumentLowPriority
A
BSONDocument
structure (BSON type0x03
).A
BSONDocument
structure (BSON type0x03
).A
BSONDocument
is basically a set of fields(String, BSONValue)
.Note: The insertion/initial order of the fields may not be maintained through the operations.
- type BSONDocumentHandler[T] = BSONDocumentReader[T] with BSONDocumentWriter[T] with BSONHandler[T]
Convenient type alias for document handlers
- trait BSONDocumentReader[T] extends BSONReader[T]
- trait BSONDocumentWriter[T] extends BSONWriter[T]
- final class BSONDouble extends BSONValue
A BSON Double.
- sealed abstract class BSONElement extends ElementProducer
- trait BSONHandler[T] extends BSONReader[T] with BSONWriter[T]
- final class BSONInteger extends BSONValue
BSON Integer value
- final class BSONJavaScript extends BSONValue
BSON JavaScript value.
- final class BSONJavaScriptWS extends BSONValue
BSON JavaScript value with scope (WS).
- final class BSONLong extends BSONValue
BSON Long value
- sealed trait BSONMaxKey extends BSONValue
BSON Max key value
- sealed trait BSONMinKey extends BSONValue
BSON Min key value
- sealed trait BSONNull extends BSONValue
BSON null value
- 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:
- sealed abstract class BSONObjectID extends BSONValue
BSON ObjectId value.
BSON ObjectId value.
+------------------------+------------------------+------------------------+------------------------+ + timestamp (in seconds) + machine identifier + thread identifier + increment + + (4 bytes) + (3 bytes) + (2 bytes) + (3 bytes) + +------------------------+------------------------+------------------------+------------------------+
- trait BSONReader[T] extends AnyRef
A reader that produces an instance of
T
from a subtype of BSONValue. - final class BSONRegex extends BSONValue
BSON Regex value.
- final class BSONString extends BSONValue
- final class BSONSymbol extends BSONValue
BSON Symbol value.
- final class BSONTimestamp extends BSONValue
BSON Timestamp value
- sealed trait BSONUndefined extends BSONValue
BSON Undefined value
- sealed trait BSONValue extends AnyRef
- trait BSONWriter[T] extends AnyRef
A writer that produces a subtype of BSONValue from an instance of
T
. - sealed trait ElementProducer extends Producer[BSONElement]
- trait FieldNaming extends (String) => String
Naming strategy, to map each class property to the corresponding field.
- sealed trait MacroConfiguration extends AnyRef
Macro configuration
- sealed trait MacroOptions extends AnyRef
Macros with 'Opts' suffix will take additional options in the form of type parameters that will customize behaviour of the macros during compilation.
- sealed trait Producer[T] extends AnyRef
- type StringOps = scala.collection.StringOps
- Definition Classes
- Aliases
- sealed trait Subtype extends AnyRef
Binary Subtype
- trait TypeNaming extends (Class[_]) => String
Naming strategy, to map each class to a discriminator value.
- final class ¬[A, B] extends AnyRef
Type level evidence that type
A
is not typeB
.Type level evidence that type
A
is not typeB
.- Annotations
- @SuppressWarnings()
Value Members
- def array(values: Producer[BSONValue]*): BSONArray
Returns an array with given values.
- def array: BSONArray
Returns an empty array.
- def bsonLocalDateHandler(zone: ZoneId): BSONHandler[LocalDate]
Returns a BSON handler for
java.time.LocalDate
, considering the specified timezone
.Returns a BSON handler for
java.time.LocalDate
, considering the specified timezone
.- Definition Classes
- DefaultBSONHandlers
- Annotations
- @inline()
- implicit val bsonLocalDateHandler: BSONHandler[LocalDate]
- Definition Classes
- DefaultBSONHandlers
- def bsonLocalDateTimeHandler(zone: ZoneId): BSONHandler[LocalDateTime]
Returns a BSON handler for
java.time.LocalDateTime
, considering the specified timezone
.Returns a BSON handler for
java.time.LocalDateTime
, considering the specified timezone
.- Definition Classes
- DefaultBSONHandlers
- Annotations
- @inline()
- implicit val bsonLocalDateTimeHandler: BSONHandler[LocalDateTime]
- Definition Classes
- DefaultBSONHandlers
- def bsonOffsetDateTimeHandler(zone: ZoneId): BSONHandler[OffsetDateTime]
Returns a BSON handler for
java.time.OffsetDateTime
, considering the specified timezone
.Returns a BSON handler for
java.time.OffsetDateTime
, considering the specified timezone
.- Definition Classes
- DefaultBSONHandlers
- Annotations
- @inline()
- implicit val bsonOffsetDateTimeHandler: BSONHandler[OffsetDateTime]
- Definition Classes
- DefaultBSONHandlers
- def bsonZonedDateTimeHandler(zone: ZoneId): BSONHandler[ZonedDateTime]
Returns a BSON handler for
java.time.ZonedDateTime
, considering the specified timezone
.Returns a BSON handler for
java.time.ZonedDateTime
, considering the specified timezone
.- Definition Classes
- DefaultBSONHandlers
- Annotations
- @inline()
- implicit val bsonZonedDateTimeHandler: BSONHandler[ZonedDateTime]
- Definition Classes
- DefaultBSONHandlers
- implicit final def collectionReader[M[_], T](implicit f: Factory[T, M[T]], reader: BSONReader[T]): BSONReader[M[T]]
- Definition Classes
- LowPriorityBSONHandlersCompat
- implicit def collectionWriter[T, Repr](implicit arg0: (Repr) => Iterable[T], writer: BSONWriter[T], notOption: ¬[Repr, Option[T]]): BSONWriter[Repr]
- Definition Classes
- LowPriorityBSONHandlers
- Annotations
- @silent()
- def document(elements: ElementProducer*): BSONDocument
Returns a document with given elements.
- def document: BSONDocument
Returns an empty document.
- def element(name: String, value: BSONValue): BSONElement
- def generateId: BSONObjectID
Returns a newly generated object ID.
- implicit def mapKeyWriter[K, V](implicit ev: (K) => StringOps, valueWriter: BSONWriter[V]): BSONDocumentWriter[Map[K, V]]
- Definition Classes
- LowerPriorityBSONHandlers
- implicit def mapReader[K, V](implicit keyReader: BSONReader[K], valueReader: BSONReader[V]): BSONDocumentReader[Map[K, V]]
- Definition Classes
- LowPriorityBSONHandlers
- implicit def mapWriter[V](implicit valueWriter: BSONWriter[V]): BSONDocumentWriter[Map[String, V]]
- Definition Classes
- LowPriorityBSONHandlers
- object BSON
Utility functions
- object BSONArray
See BSONArray
- implicit object BSONArrayIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONArray]
- Definition Classes
- BSONIdentityHandlers
- object BSONBinary
- implicit object BSONBinaryHandler extends BSONHandler[Array[Byte]] with SafeBSONWriter[Array[Byte]]
- Definition Classes
- DefaultBSONHandlers
- implicit object BSONBinaryIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONBinary]
- Definition Classes
- BSONIdentityHandlers
- object BSONBoolean
- implicit object BSONBooleanHandler extends BSONHandler[Boolean] with SafeBSONWriter[Boolean]
- Definition Classes
- DefaultBSONHandlers
- implicit object BSONBooleanIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONBoolean]
- Definition Classes
- BSONIdentityHandlers
- object BSONBooleanLike
- object BSONDateTime
- implicit object BSONDateTimeHandler extends BSONHandler[Instant] with SafeBSONWriter[Instant]
- Definition Classes
- DefaultBSONHandlers
- implicit object BSONDateTimeIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONDateTime]
- Definition Classes
- BSONIdentityHandlers
- object BSONDecimal
- implicit object BSONDecimalHandler extends BSONHandler[BigDecimal]
- Definition Classes
- DefaultBSONHandlers
- implicit object BSONDecimalIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONDecimal]
- Definition Classes
- BSONIdentityHandlers
- object BSONDocument
- object BSONDocumentHandler
Handler factory
- implicit object BSONDocumentIdentity extends BSONDocumentReader[BSONDocument] with BSONDocumentWriter[BSONDocument]
- Definition Classes
- BSONIdentityHandlers
- object BSONDocumentReader
- object BSONDocumentWriter
- object BSONDouble
- implicit object BSONDoubleHandler extends BSONHandler[Double] with SafeBSONWriter[Double]
- Definition Classes
- DefaultBSONHandlers
- implicit object BSONDoubleIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONDouble]
- Definition Classes
- BSONIdentityHandlers
- object BSONElement extends BSONElementLowPriority
- implicit object BSONFloatHandler extends BSONHandler[Float] with SafeBSONWriter[Float]
- Definition Classes
- DefaultBSONHandlers
- object BSONHandler
- object BSONInteger
- implicit object BSONIntegerHandler extends BSONHandler[Int] with SafeBSONWriter[Int]
- Definition Classes
- DefaultBSONHandlers
- implicit object BSONIntegerIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONInteger]
- Definition Classes
- BSONIdentityHandlers
- object BSONJavaScript
- implicit object BSONJavaScriptIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONJavaScript]
- Definition Classes
- BSONIdentityHandlers
- object BSONJavaScriptWS
- implicit object BSONJavaScriptWSIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONJavaScriptWS]
- Definition Classes
- BSONIdentityHandlers
- object BSONLong
- implicit object BSONLongHandler extends BSONHandler[Long] with SafeBSONWriter[Long]
- Definition Classes
- DefaultBSONHandlers
- implicit object BSONLongIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONLong]
- Definition Classes
- BSONIdentityHandlers
- object BSONMaxKey extends BSONMaxKey
- implicit object BSONMaxKeyIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONMaxKey]
- Definition Classes
- BSONIdentityHandlers
- object BSONMinKey extends BSONMinKey
- implicit object BSONMinKeyIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONMinKey]
- Definition Classes
- BSONIdentityHandlers
- object BSONNull extends BSONNull
- implicit object BSONNullIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONNull]
- Definition Classes
- BSONIdentityHandlers
- object BSONNumberLike
- object BSONObjectID
- implicit object BSONObjectIDIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONObjectID]
- Definition Classes
- BSONIdentityHandlers
- object BSONReader
- object BSONRegex
- implicit object BSONRegexIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONRegex]
- Definition Classes
- BSONIdentityHandlers
- object BSONString
- implicit object BSONStringHandler extends BSONHandler[String] with SafeBSONWriter[String]
- Definition Classes
- DefaultBSONHandlers
- implicit object BSONStringIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONString]
- Definition Classes
- BSONIdentityHandlers
- object BSONSymbol
- implicit object BSONSymbolIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONSymbol]
- Definition Classes
- BSONIdentityHandlers
- object BSONTimestamp
Timestamp companion
- implicit object BSONTimestampIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONTimestamp]
- Definition Classes
- BSONIdentityHandlers
- implicit object BSONURIHandler extends BSONHandler[URI] with SafeBSONWriter[URI]
- Definition Classes
- DefaultBSONHandlers
- implicit object BSONURLHandler extends BSONHandler[URL] with SafeBSONWriter[URL]
- Definition Classes
- DefaultBSONHandlers
- object BSONUndefined extends BSONUndefined
- implicit object BSONUndefinedIdentity extends bson.DefaultBSONHandlers.IdentityBSONHandler[BSONUndefined]
- Definition Classes
- BSONIdentityHandlers
- object BSONValue extends BSONValueLowPriority1
- implicit object BSONValueIdentity extends BSONReader[BSONValue] with BSONWriter[BSONValue]
- Definition Classes
- BSONIdentityLowPriorityHandlers
- object BSONWriter
- object ElementProducer extends ElementProducerLowPriority
- object FieldNaming
Naming companion
- object MacroConfiguration
- object MacroOptions
- object Macros
Macros for generating
BSONReader
andBSONWriter
at compile time.Macros for generating
BSONReader
andBSONWriter
at compile time.case class Person(name: String, surname: String) implicit val personHandler = Macros.handler[Person]
- See also
MacroOptions for specific options
MacroConfiguration for extended configuration
- object Subtype
- object TypeNaming
- object ¬
- Annotations
- @SuppressWarnings()