[DRIVERS-740] Support new $meta expressions in MongoDB 4.4 Created: 03/Sep/19  Updated: 28/Oct/23  Resolved: 02/Apr/20

Status: Closed
Project: Drivers
Component/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CSHARP-2752 Support all new $meta projections Closed
depends on JAVA-3445 Support new $meta expressions in Mong... Closed
depends on CDRIVER-3372 Investigate changes in SERVER-42418: ... Closed
depends on CXX-1821 Investigate changes in SERVER-42418: ... Closed
depends on GODRIVER-1319 Allow ExpressionMeta to parse find() ... Closed
depends on MOTOR-394 Investigate changes in SERVER-42418: ... Closed
depends on NODE-2174 Investigate changes in SERVER-42418: ... Closed
depends on PHPC-1447 Investigate changes in SERVER-42418: ... Closed
depends on PYTHON-1987 Investigate changes in SERVER-42418: ... Closed
depends on RUBY-1941 Investigate changes in SERVER-42418: ... Closed
depends on SERVER-42418 Allow ExpressionMeta to parse find() ... Closed
Server Compat: 4.3
Driver Compliance:
Key Status/Resolution FixVersion
NODE-2174 Works as Designed
JAVA-3445 Fixed 4.1.0
CXX-1821 Won't Do
CSHARP-2752 Fixed 2.11.0
MOTOR-394 Won't Fix
PYTHON-1987 Won't Fix
RUBY-1941 Won't Do
PHPC-1447 Won't Do
CDRIVER-3372 Won't Do
GODRIVER-1319 Won't Do

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


Generated at Thu Feb 08 08:22:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.