Description Usage Arguments Details Value See Also Examples
Append raw (binary) data onto a mongo.bson.buffer.
1 | mongo.bson.buffer.append.raw(buf, name, value, subtype = NULL)
|
buf |
(mongo.bson.buffer) The buffer object to which to append. |
name |
(string) The name (key) of the field appended to the buffer. |
value |
(raw) the binary data. |
subtype |
(as.integer) The binary data subtype. If subtype == NULL, the "subtype" attribute of the raw is used. If this is not present, mongo.binary.binary is used. The following constants are defined:
|
BSON has a special field type to indicate binary data. This function appends such an indicator as the type of a field with its value.
If value has a dims
attribute of length > 1, any names
or
dimnames
attribute is ignored and a nested array is appended.
(Use
mongo.bson.buffer.append.object()
if you want to preserve
dimnames
).
TRUE if successful; otherwise, FALSE if an error occured appending the data.
mongo.bson.buffer.append
,
mongo.bson,
mongo.bson.buffer.
1 2 3 4 5 6 7 8 9 10 11 | buf <- mongo.bson.buffer.create()
bin <- raw(3)
for (i in 0:2)
bin[i] <- as.raw(i * 3)
mongo.bson.buffer.append.raw(buf, "bin1", bin)
# Note that mongo.bson.buffer.append()
# will detect whether the value parameter
# is a raw object and append the appropriate value.
mongo.bson.buffer.append(buf, "bin2", bin) # gives same result
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.