Kotlin BSON • Multiplatform abstraction for different BSON implementations • opensavvy.ktmongo.bson.types • ObjectId • ObjectId
ObjectId¶
Constructs a new ObjectId
from its different components.
constructor(bytes: ByteArray)
Constructs a new ObjectId
by reading a byte array.
bytes should be exactly 12-bytes long.
To access the bytes of an existing ObjectId, see ObjectId.bytes
.
constructor(hex: String)
Constructs a new ObjectId
by reading a hexadecimal representation.
hex should be exactly 24 characters long (12 bytes).
To access the hexadecimal representation of an existing ObjectId, see ObjectId.hex
.