mongo.oid.from.string(hexstr)
Note that although an error is thrown if the length is not 24, no error is thrown if the characters are not hex digits; you'll get zero bits for the invalid digits.
mongo.oid.create
,
as.character.mongo.oid
,
mongo.oid.to.string
,
mongo.bson.buffer.append
,
mongo.bson.buffer.append.oid
,
mongo.bson.buffer.append.list
, mongo.bson.buffer,
mongo.bson.
buf <- mongo.bson.buffer.create()
oid <- mongo.oid.from.string("ABCD1234EFAB5678CDEF9012")
mongo.bson.buffer.append(buf, "_id", oid)
b <- mongo.bson.from.buffer(buf)
Run the code above in your browser using DataLab