[DOCS-15510] Investigate changes in SERVER-67284: $fill.partitionByFields does not allow the dot notation for embedded documents Created: 28/Jul/22  Updated: 22/Jan/24

Status: Backlog
Project: Documentation
Component/s: Server
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: backlog, feature, query, server-docs-bug-bash
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-67284 $fill.partitionByFields does not allo... Closed
Participants:
Days since reply: 1 year, 27 weeks, 6 days ago

 Description   
Original Downstream Change Summary

This enables an additional way of specifying partitions in $fill

Description of Linked Ticket

The following experiment run in mongosh against MongoDB 5.3.1

use myDb
db.myColl.drop()
db.runCommand({"insert": "myColl", "documents": [
    {"_id": 1, "partition": {"id": 10}, "field": 1},
    {"_id": 2, "partition": {"id": 10}},
    {"_id": 3, "partition": {"id": 20}, "field": 3}] })
db.runCommand({"aggregate": "myColl", "pipeline": [
    {"$fill": {
        "output": {
            "field": {"method": "locf"}
        },
        "sortBy": {"_id": -1},
        "partitionByFields": ["partition.id"] }},
    {"$sort": {"_id": 1}},
    {"$project": {"field": true, "_id": false} }],
    "cursor": {} })

results in

MongoServerError: FieldPath field names may not contain '.'. Consider using $getField or $setField.

Replacing

"partitionByFields": ["partition.id"]

with

"partitionBy": {"p": "$partition.id"}

makes it work and produce

[ { field: 1 }, { field: null }, { field: 3 } ]

kateryna.kamenieva@mongodb.com confirmed that this is a bug and the dot notation for embedded documents was intended to be supported in $fill.partitionByFields similarly to how it is supported in $densify.partitionByFields:



 Comments   
Comment by Education Bot [ 28/Jul/22 ]

Fix Version updated for upstream SERVER-67284:
6.1.0-rc0

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