Learn R Programming

rmongodb (version 1.8.0)

mongo.oid: The mongo.oid class

Description

Objects of class "mongo.oid" represent MongoDB Object IDs.

Arguments

Details

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

mongo.oid objects contain an externally managed pointer to the actual 12-byte object ID data. This pointer is stored in the "mongo.oid" attribute of the object.

mongo.oid objects have "mongo.oid" as their class so that mongo.bson.buffer.append() may detect them and append the appropriate BSON OID-typed value to a buffer.

mongo.oid values may also be present in a list and will be handled properly by mongo.bson.buffer.append.list() and mongo.bson.from.list().

See Also

mongo.oid, mongo.oid.from.string, as.character.mongo.oid, mongo.oid.to.string, mongo.oid.time, 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.create()
mongo.bson.buffer.append(buf, "_id", oid)
b <- mongo.bson.from.buffer(buf)

Run the code above in your browser using DataLab