Learn R Programming

rmongodb (version 1.8.0)

mongo.bson.empty: Create an empty mongo.bson object

Description

Returns an empty mongo.bson object. mongo.bson objects have "mongo.bson" as their class and contain an externally managed pointer to the actual data. This pointer is stored in the "mongo.bson" attribute of the object.

Usage

mongo.bson.empty()

Arguments

Value

An empty mongo.bson object

See Also

mongo.bson

Examples

Run this code
# Use an empty mongo.bson for the query object which matches everything.
# This happens to be the default value for the query
# parameter to mongo.count,  but we explicity use mongo.bson.empty()
# here for an example.
mongo <- mongo.create()
if (mongo.is.connected(mongo))
    print(mongo.count(mongo, "test.people", query=mongo.bson.empty()))

Run the code above in your browser using DataLab