sealed abstract class BSONObjectID extends BSONValue
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
- Alphabetic
- By Inheritance
- BSONObjectID
- BSONValue
- AnyRef
- Any
- by valueProducer
- by identityValueProducer
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Concrete Value Members
-
final
def
asOpt[T](implicit reader: BSONReader[T]): Option[T]
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]
- Definition Classes
- BSONValue
- Annotations
- @inline()
-
final
def
asTry[T](implicit reader: BSONReader[T]): Try[T]
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]
- Definition Classes
- BSONValue
-
final
def
byteArray: Array[Byte]
Returns the whole binary content as array.
-
val
byteCode: Byte
The code indicating the BSON type for this value as Byte
The code indicating the BSON type for this value as Byte
- Definition Classes
- BSONObjectID → BSONValue
-
val
code: Int
The code indicating the BSON type for this value
The code indicating the BSON type for this value
- Definition Classes
- BSONObjectID → BSONValue
-
def
equals(that: Any): Boolean
- Definition Classes
- BSONObjectID → AnyRef → Any
-
lazy val
hashCode: Int
- Definition Classes
- BSONObjectID → AnyRef → Any
-
lazy val
stringify: String
The hexadecimal String representation.
The hexadecimal String representation.
import reactivemongo.api.bson.BSONObjectID def foo(oid: BSONObjectID): scala.util.Try[BSONObjectID] = { val repr: String = oid.stringify BSONObjectID.parse(repr) }
-
final
def
time: Long
The time of this BSONObjectId, in milliseconds
The time of this BSONObjectId, in milliseconds
- Annotations
- @inline()
-
def
toString(): String
- Definition Classes
- BSONObjectID → AnyRef → Any