-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Labels:
Description
Adds a new $function expression which can execute javascript code.
Description of Linked Ticket
Rename $_internalJs to $function, and change how it parses its arguments.
$function takes the following required fields:
- body - a function given as a constant expression of the String or Code BSON type
- args - function’s arguments given by an expression evaluating to the Array BSON type.
- lang - a language specifier given as a constant expression of the String type; the only acceptable value for now is 'js'
Update MapReduce where necessary to generate $function expressions instead of $_internalJs.
Because this is a new operator, we should restrict its use to FCV 4.4 to prevent problems with downgrade (for example, to prevent users from creating views that would be invalid on 4.2). But we should also make sure MapReduce still works on FCV 4.2, even though it uses this new operator internally.
Scope of changes
Impact to Other Docs
MVP (Work and Date)
Resources (Scope or Design Docs, Invision, etc.)
- documents
-
SERVER-42644 M/R Agg: Add $_internalJs expression
- Closed
-
SERVER-45453 Change name and usage of $_internalJs to $function
- Closed
- related to
-
DOCS-13387 Investigate changes in SERVER-45456: Allow JavaScript on mongos
- Closed