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