classafBson::Code
sys::Obj afBson::Code
(BSON Type) - Wraps a JavaScript function and default variable values.
scope
values are automatically evaluated in the context of the code when it is executed. Example:
Code("function (x) { return x + y; }", ["y":2])
Code objects let you re-use functions and change their parameters without re-interpolating a Str function.
Note: Code
is not const
because the scope
document could contain Binary data. Besides, it is advantageous to change the scope / variable values.