Does $sortByCount work in compass?

I tried to create a pipeline in compass using sortByCount but I’m not getting any results.
I also saw this jira :


Let’s see your screenshots.

It was just a trial test on a local database under $sortByCount option


  • expression: Grouping expression or string.

Exporting pipeline to language returns this

A match exports returns this
$match: {
“type”: “Refinement”

This line works in mongoshell[{$sortByCount: “$type”}])

It’s a bug! Remove the curly braces and have it looking like this:
The support ticket is very disappointing, especially for a bug that was reported in version 1.16 and we’re now in version 1.20. And all it says is “Won’t fix” without any comments from the staff who closed the ticket.
@Sonali_Mamgain may have some insight :slight_smile:

That worked, thank you :slight_smile:

You also have to remove any extra blank lines, the expression has to be right after the comments.

( Might be a problem in the token parsing yeah, or maybe the syntax analysis. )