[COMPASS-7201] Aggregation results are different when performed in compass UI and mongosh Created: 10/Sep/23  Updated: 27/Oct/23  Resolved: 11/Sep/23

Status: Closed
Project: Compass
Component/s: None
Affects Version/s: None
Fix Version/s: No version

Type: Bug Priority: Major - P3
Reporter: Stas Baskin Assignee: Unassigned
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS: Mac arm
node.js / npm versions: 9.6.4


Attachments: PNG File Screenshot 2023-09-10 at 12.54.08.png    
Documentation Changes: Not Needed

 Description   

Problem Statement/Rationale

Compass aggregation with $group and $sum showing incorrect results.

Steps to Reproduce

Aggregation type:
db.col.aggregate([\{$group: {_id: "$field1", count: {$sum:1}}}, \\\{$sort: {count: -1}}])

Expected Results

Results in compass and mongosh should be identical

Actual Results

See attached image.  Compass results are incorrect.

 

Compass version: 1.39.1



 Comments   
Comment by Le Roux Bodenstein [ 11/Sep/23 ]

Hi Stas

Compass's aggregation preview is based on a sample. To get the full results you can click the green Run button top-right. If you still get different results, please let us know.

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