mongo.symbol.create: Create a mongo.symbol object

Description Usage Arguments Value See Also Examples

View source: R/bson.R

Description

Create a mongo.symbol object for appending to a buffer with
mongo.bson.buffer.append() or for embedding in a list such that mongo.bson.buffer.append.list() will properly insert a symbol value into the mongo.bson.buffer object.

Usage

1

Arguments

value

(string) The value of the symbol

Value

a mongo.symbol object

See Also

mongo.symbol,
mongo.bson.buffer.append,
mongo.bson.buffer.append.list,
mongo.bson.buffer,
mongo.bson.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
buf <- mongo.bson.buffer.create()
sym <- mongo.symbol.create("Alpha")
mongo.bson.buffer.append(buf, "A", sym)
lst <- list(s1 = sym, One = 1)
mongo.bson.buffer.append.list(buf, "listWsym", lst)
mongo.bson.buffer.append.symbol(buf, "D", "Delta")
b <- mongo.bson.from.buffer(buf)

# the above will create a mongo.bson object of the following form:
# { "A": (SYMBOL) "Alpha",
#   "listWsym" : { "a1"  : (SYMBOL) "Aplha",
#                  "One" : 1 },
#   "D" : (SYMBOL) "Delta" }

jonkatz2/rmongodb documentation built on May 19, 2019, 7:30 p.m.