Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-740

Support new $meta expressions in MongoDB 4.4

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: None
    • None

      Downstream Change Summary

      This ticket adds support for new options in the $meta expression. Currently the only documented option is "textScore." In 4.4 these will be the options:

      https://github.com/mongodb/mongo/blob/0e6b9119f4d3a0fae681ed28220bc55ed1469f81/src/mongo/db/pipeline/expression.cpp#L2528-L2536

      Note that the docs are incorrect even for 4.2 (agg) $meta. In 4.2 $meta supports "textScore", "randVal", "searchScore" and "searchHighlights."

      In 4.4 there will be no concept of "agg $meta" opposed to "find() $meta", but there will be a separate ticket about that.

      Description of Linked Ticket

      Add support for "recordId" "indexKey" and "sortKey" in ExpressionMeta.

      Like other meta types, the expression should returning "missing" if the associated metadata cannot be found on the Document.

      This ticket will also involve modifying Document and DocumentMetadataFields. The main purpose of this work is to make ExpressionMeta supercede find() $meta.

      Note that the work of figuring out how to pass metadata between the PlanStage and DocumentSource layer is tracked by SERVER-42560. This ticket is just about making $meta able to parse the new metadata options and retrieve them from a Document. Until we support expressions in find() projection, the change will not actually have any "visible" effects.

            Assignee:
            Unassigned Unassigned
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: