Learn R Programming

rmongodb (version 1.8.0)

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

Description

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

Usage

mongo.oid.from.string(hexstr)

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.

Value

A mongo.oid object constructed from hexstr.

Details

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

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

Run this code
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