[COMPASS-7216] The template for a $sortByCount stage is incorrect Created: 13/Sep/23  Updated: 01/Nov/23  Resolved: 01/Nov/23

Status: Closed
Project: Compass
Component/s: Aggregation pipeline, Autocomplete
Affects Version/s: 1.39.4
Fix Version/s: No version

Type: Bug Priority: Minor - P4
Reporter: Peter Williamson Assignee: Unassigned
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS: macos


Documentation Changes: Not Needed
Sprint: Up for triaging

 Description   

Problem Statement/Rationale

In the aggregation builder the template for a $sortByCount stage is:

 
/**
 * expression: Grouping expression or string.
 */
{
  expression
}

the braces are invalid a valid stage is:

{$sortByCount: "$fieldName"}

so the template should be:

/**
 * expression: Grouping expression or string.
 */
  expression

**

Please be sure to attach relevant logs with any sensitive data redacted.
How to retrieve logs for: Compass; Shell

Steps to Reproduce

Create a $sortByStage in the aggregation builder

Expected Results

template is valid

Actual Results

Error message "Stage value is invalid"

 


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