object BSONDocument
BSONDocument factories & utilities.
reactivemongo.api.bson.BSONDocument("foo" -> 1, "bar" -> "lorem")
- Alphabetic
- By Inheritance
- BSONDocument
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
type
Strict = BSONDocument with BSONStrictDocument
EXPERIMENTAL
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply(elms: Iterable[(String, BSONValue)]): BSONDocument
Creates a new BSONDocument containing the unique elements from the given collection (only one instance of a same element, same name & value, is kept).
Creates a new BSONDocument containing the unique elements from the given collection (only one instance of a same element, same name & value, is kept).
import reactivemongo.api.bson._ BSONDocument(Seq( "foo" -> BSONInteger(1), "bar" -> BSONString("lorem"))) // { 'foo': 1, 'bar': 'lorem' }
-
def
apply(elms: ElementProducer*): BSONDocument
Creates a new BSONDocument containing the unique elements from the given collection (only one instance of a same element, same name & value, is kept).
Creates a new BSONDocument containing the unique elements from the given collection (only one instance of a same element, same name & value, is kept).
reactivemongo.api.bson.BSONDocument( "foo" -> 1, "bar" -> "lorem" ) // => { 'foo': 1, 'bar': 'lorem' }
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
val
empty: BSONDocument
An empty BSONDocument.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
newBuilder: Builder[ElementProducer, BSONDocument]
EXPERIMENTAL: Returns a BSONDocument builder.
EXPERIMENTAL: Returns a BSONDocument builder.
import reactivemongo.api.bson.{ BSONDocument, ElementProducer } val builder = BSONDocument.newBuilder builder += ("foo" -> 1) builder ++= Seq("bar" -> "lorem", "ipsum" -> 3.45D) builder ++= Some[ElementProducer]("dolor" -> 6L) // builder.result() == {'foo':1, 'bar':'lorem', 'ipsum':3.45, 'dolor':6}
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
pretty(doc: BSONDocument): String
Returns a String representing the given BSONDocument.
Returns a String representing the given BSONDocument.
import reactivemongo.api.bson.BSONDocument def printDoc(doc: BSONDocument): String = BSONDocument.pretty(doc)
- See also
-
def
strict(elms: Iterable[(String, BSONValue)]): Strict
EXPERIMENTAL: Creates a new BSONDocument containing the elements deduplicated by name from the given collection (only the last is kept for a same name).
EXPERIMENTAL: Creates a new BSONDocument containing the elements deduplicated by name from the given collection (only the last is kept for a same name). Then append operations on such document will maintain element unicity by field name (see
BSONStrictDocument.++
).import reactivemongo.api.bson._ BSONDocument.strict(Seq( "foo" -> BSONInteger(1), "foo" -> BSONString("lorem"))) // { 'foo': 1 }
-
def
strict(elms: ElementProducer*): Strict
EXPERIMENTAL: Creates a new BSONDocument containing the elements deduplicated by name from the given collection (only the last is kept for a same name).
EXPERIMENTAL: Creates a new BSONDocument containing the elements deduplicated by name from the given collection (only the last is kept for a same name). Then append operations on such document will maintain element unicity by field name (see
BSONStrictDocument.++
).reactivemongo.api.bson.BSONDocument("foo" -> 1, "bar" -> 2, "foo" -> 3) // => { "foo": 1, "bar": 2 } : No "foo": 3
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
unapply(that: Any): Option[Seq[BSONElement]]
Extracts the elements if
that
's a BSONDocument.Extracts the elements if
that
's a BSONDocument.import reactivemongo.api.bson.{ BSONDocument, BSONValue } def names(v: BSONValue): Seq[String] = v match { case BSONDocument(elements) => elements.map(_.name) case _ => Seq.empty[String] }
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()