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 } }
Run the code above in your browser using DataLab