Description Details See Also Examples
Objects of class "mongo.symbol" are used to represent symbol values in BSON documents.
mongo.symbol objects' value is a string representing the value of the symbol.
mongo.symbol objects have "mongo.symbol" as their class so that
mongo.bson.buffer.append()
may detect them and append the
appropriate BSON symbol-typed value to a buffer.
These mongo.symbol values may also be present in a list and will be handled
properly
by mongo.bson.buffer.append.list()
and
mongo.bson.from.list()
.
mongo.symbol.create
,
mongo.bson.buffer.append
,
mongo.bson.buffer.append.list
,
mongo.bson.buffer,
mongo.bson.
1 2 3 4 5 6 7 8 9 10 11 | buf <- mongo.bson.buffer.create()
sym <- mongo.symbol.create("Beta")
mongo.bson.buffer.append(buf, "B", sym)
l <- list(s1 = sym, Two = 2)
mongo.bson.buffer.append.list(buf, "listWsym", l)
b <- mongo.bson.from.buffer(buf)
# the above will create a mongo.bson object of the following form:
# { "B": (SYMBOL) "Beta",
# "listWsym" : { "s1" : (SYMBOL) "Beta",
# "Two" : 2 } }
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.