Description Usage Arguments Details Value See Also Examples
Append a mongo.bson.iterator's element into a mongo.bson.buffer.
1 | mongo.bson.buffer.append.element(buf, name, value)
|
buf |
(mongo.bson.buffer) The buffer object to which to append. |
name |
(string) The name (key) of the subobject field appended to the buffer. If NULL, the name appended will come from the element pointed to by the iterator. |
value |
A (mongo.bson.iterator) object. |
mongo.bson.buffer.append()
will detect if its value parameter
is a mongo.bson.iterator object and perform the same action as this
function.
TRUE if successful; otherwise, FALSE if an error occured appending the data.
mongo.bson,
mongo.bson.buffer,
mongo.bson.find
,
mongo.bson.from.list
,
mongo.bson.buffer.append
.
1 2 3 4 5 6 7 8 | 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" }
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.