Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-13493

Investigate changes in SERVER-45453: Change name and usage of $_internalJs to $function

      Description

      Downstream Change Summary

      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.)

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              1 year, 51 weeks ago