Description Usage Arguments Value See Also Examples
Create a mongo.code.w.scope 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
code value into the mongo.bson.buffer object.
1 | mongo.code.w.scope.create(code, scope)
|
code |
(string) javascript code |
scope |
(mongo.bson) the scope object |
A mongo.code.w.scope object
mongo.code.w.scope,
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()
mongo.bson.buffer.append(buf, "scopevar", "scopevalue")
scope <- mongo.bson.from.buffer(buf)
codeWscope <- mongo.code.w.scope.create("y = x", scope)
buf <- mongo.bson.buffer.create()
mongo.bson.buffer.append(buf, "CodeWscope", codeWscope)
b <- mongo.bson.from.buffer(buf)
# The above produces a BSON object of the form:
# { "CodeWscope" : (CODEWSCOPE) "y = x"
# (SCOPE) { "scopevar" : "scopevalue" } }
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.