name <- mongo.bson.from.list(list(first="Joe", last="Smith"))
iter <- mongo.bson.find(name, "last")
buf <- mongo.bson.buffer.create()
mongo.bson.buffer.append.element(buf, "last", iter)
b <- mongo.bson.from.buffer(buf)
# the above will create a mongo.bson object (b) of the following form:
# { "last" : "Smith" }
Run the code above in your browser using DataLab