[COMPASS-4071] Valid $set stages in aggregation pipeline are not parsed correctly. Created: 09/Jan/20  Updated: 29/Oct/23  Resolved: 17/Mar/20

Status: Closed
Project: Compass
Component/s: Aggregation pipeline, Grammar
Affects Version/s: 1.20.3
Fix Version/s: 1.22.0

Type: Bug Priority: Major - P3
Reporter: Andrzej Taramina Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu Linux 18.04


Issue Links:
Problem/Incident
causes COMPASS-4146 Disable validation in agg builder, qu... Closed

 Description   

Valid $set stages in aggregation pipeline are not parsed correctly and show errors. This also affects importing of text-based aggregation pipelines.

The following are valid $set stage definitions. They run fine as part of a larger pipeline using NodeJS and were used using mongo shell to create a view from the same pipeline, but cannot be imported in Compass without showing errors:

{
    "$set": {
      "profile": {
        "$arrayElemAt": [
          "$profile_array",
          0
        ]
      }
    }
  }

and....

{
    "$set": {
      "sort_status": {
        "$indexOfArray": [
          [
            "H",
            "N",
            "0"
          ],
          "$medical_status_code"
        ]
      }
    }
  }


Generated at Wed Feb 07 22:35:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.