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

Description Usage Arguments Value See Also Examples

View source: R/bson.R

Description

Get the number of bytes taken up by the BSON data attached to the mongo.bson object

Usage

1

Arguments

b

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

Value

(integer) the number of bytes taken up by the BSON data attached to the mongo.bson object.

See Also

mongo.bson

Examples

1
2
3
4
5
6
7
8
9
# should report 5
print(mongo.bson.size(mongo.bson.empty()))

buf <- mongo.bson.buffer.create()
mongo.bson.buffer.append(buf, "name", "Fred")
mongo.bson.buffer.append(buf, "city", "Dayton")
y <- mongo.bson.from.buffer(buf)
# should report 37
print(mongo.bson.size(y))

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