mongo.oid.from.string: Create a mongo.oid object ftom a string

Description Usage Arguments Details Value See Also Examples

View source: R/bson.R

Description

Create from a 24-character hex string a mongo.oid object representing a MongoDB Object ID.

Usage

1

Arguments

hexstr

(string) 24 hex characters representing the OID.

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.

Details

See http://www.mongodb.org/display/DOCS/Object+IDs

Value

A mongo.oid object constructed from hexstr.

See Also

mongo.oid,
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.

Examples

1
2
3
4
buf <- mongo.bson.buffer.create()
oid <- mongo.oid.from.string("ABCD1234EFAB5678CDEF9012")
mongo.bson.buffer.append(buf, "_id", oid)
b <- mongo.bson.from.buffer(buf)

jonkatz2/rmongodb documentation built on May 19, 2019, 7:30 p.m.