MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

Compass aggregate pipeline doc count

after setting up the first stage $match…
is there no resulting doc count?
I see the 'Output after $match stage (Sample of 20…) pane on right but cannot seem to see anywhere the count of docs that result from the match

Compass’ Aggregation Pipeline Builder currently only shows a preview of documents for a $match stage to help you develop your pipeline. Where possible, Compass is trying to avoid executing the full pipeline (for example, sampling the collection by default) so the editing experience is more responsive.

If you want to see a full count of matching documents you can add a $count stage after the $match, but I don’t believe there is an equivalent UI toggle for this in the current stable version of Compass (1.20.5).

I suggest posting this as a feature suggestion on the MongoDB Feedback site for others to upvote & watch.

Regards,
Stennie

2 Likes

I get what you’re saying…running the query in a large db when building a pipeline would be an issue…doing a $count stage is viable…

but when you do want to run it - no run button? it’s running the 20 samples on the fly …so for a full result review…you have to copy the code over to shell command I guess…maybe have it write to a file… hmmmmm…

no designer friendly view of query results…whether command shell or that small window with the horizontal slider in Compass…kind of have morphed into a different topic though…still learning …