BSON ObjectId value.
import scala.util.Try
import reactivemongo.api.bson.BSONObjectID
val oid: BSONObjectID = BSONObjectID.generate()
def foo: Try[BSONObjectID] = BSONObjectID.parse(oid.stringify)
Timestamp (seconds) | Machine identifier | Thread identifier | Increment |
---|---|---|---|
4 bytes | 3 bytes | 2 bytes | 3 bytes |
- Companion:
- object
Value members
Concrete methods
Inherited methods
Optionally parses this value as a T
one.
Optionally parses this value as a T
one.
- Returns:
Some
successfully parsed value, orNone
if failsimport reactivemongo.api.bson.BSONValue def foo(v: BSONValue): Option[String] = v.asOpt[String]
- Inherited from:
- BSONValue
Tries to parse this value as a T
one.
Tries to parse this value as a T
one.
import scala.util.Try
import reactivemongo.api.bson.BSONValue
def foo(v: BSONValue): Try[String] = v.asTry[String]
- Inherited from:
- BSONValue