mongo.bson.buffer.size: Get the size of a mongo.bson.buffer object

Description Usage Arguments Value See Also Examples

View source: R/bson.R

Description

Get the number of bytes which would be taken up by the BSON data when the buffer is converted to a mongo.bson object with mongo.bson.from.buffer().

Usage

1

Arguments

buf

(mongo.bson.buffer) the mongo.bson.buffer object to examine.

Value

(integer) the number of bytes which would be taken up by the BSON data with the buffer is converted to a mongo.bson object with mongo.bson.from.buffer().

See Also

mongo.bson.buffer,
mongo.bson.

Examples

1
2
3
4
5
6
7
buf <- mongo.bson.buffer.create()
mongo.bson.buffer.append(buf, "name", "Fred")
mongo.bson.buffer.append(buf, "city", "Dayton")
# both should report 37
print(mongo.bson.buffer.size(buf))
y <- mongo.bson.from.buffer(buf)
print(mongo.bson.size(y))

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