buf <- mongo.bson.buffer.create()
mongo.bson.buffer.append.symbol(buf, "A", "Alpha")
b <- mongo.bson.from.buffer(buf)
# The above produces a BSON object of the form { "A" : (SYMBOL) "Alpha" }
# The same result can be produced by the following code:
buf <- mongo.bson.buffer.create()
sym <- mongo.symbol.create("Alpha")
mongo.bson.buffer.append(buf, "A", sym)
b <- mongo.bson.from.buffer(buf)
Run the code above in your browser using DataLab