Learn R Programming

rmongodb (version 1.8.0)

mongo.bson.from.buffer: Convert a mongo.bson.buffer object to a mongo.bson object

Description

Convert a mongo.bson.buffer object to a mongo.bson object.

Usage

mongo.bson.from.buffer(buf)

Arguments

buf
(mongo.bson.buffer) The buffer to convert.

Value

A mongo.bson object as converted from the buffer parameter.

Details

Use this after appending data to a buffer to turn it into a mongo.bson object for network transport.

No futher data may be appended to the buffer after calling this function.

See Also

mongo.bson, mongo.bson.buffer, mongo.bson.buffer.append, mongo.bson.destroy.

Examples

Run this code
buf <- mongo.bson.buffer.create()
mongo.bson.buffer.append(buf, "name", "Fred")
mongo.bson.buffer.append(buf, "city", "Dayton")
b <- mongo.bson.from.buffer(buf)
print(b)
mongo.bson.destroy(b)

Run the code above in your browser using DataLab