Learn R Programming

rmongodb (version 1.8.0)

mongo.bson.iterator: The mongo.bson.iterator class

Description

Objects of class "mongo.bson.iterator" are used to iterate through BSON documents as stored in mongo.bson objects.

Arguments

Details

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

See Also

mongo.bson.iterator.create, mongo.bson.find, mongo.bson.iterator.next, mongo.bson.iterator.key, mongo.bson.iterator.value, mongo.bson.

Examples

Run this code
b <- mongo.bson.from.list(list(name="Joy", age=35, city="Ontario"))
# b is of class "mongo.bson"
iter <- mongo.bson.iterator.create(b)
while (mongo.bson.iterator.next(iter))
    print(mongo.bson.iterator.value(iter))

Run the code above in your browser using DataLab