as.character.mongo.oid: Convert a mongo.oid object to a string

Description Usage Arguments Details Value See Also Examples

View source: R/bson.R

Description

Convert a mongo.oid object to a string of 24 hex digits. This performs the inverse operation of mongo.oid.from.string().

Usage

1
2
## S3 method for class 'character.mongo.oid'
as(x, ...)

Arguments

x

(mongo.oid) The OID to be converted.

...

Parameters passed from generic.

Details

This function is an alias of mongo.oid.to.string() so that the class mechanism of R allows it to be called simply by as.character(oid).

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

Value

(string) A string of 24 hex digits representing the bits of oid x.

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

Examples

1
2
3
oid <- mongo.oid.create()
print(as.character.mongo.oid(oid))
print(as.character(oid))  # print same thing as above line

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