[DOCS-8144] Document new $count aggregation stage for the 3.4 manual Created: 21/Jun/16  Updated: 22/Nov/16  Resolved: 11/Nov/16

Status: Closed
Project: Documentation
Component/s: Server
Affects Version/s: None
Fix Version/s: 3.4.0

Type: Task Priority: Major - P3
Reporter: David Storch Assignee: Steve Renaker (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-23836 add $count stage to aggregation Closed
Participants:
Days since reply: 7 years, 12 weeks, 1 day ago
Epic Link: 3.4 Agg/Arrays
Story Points: 1

 Description   

SERVER-23836 added a new aggregation stage $count that is syntactic sugar for {$group:{_id:null, count:{$sum:1}}}.

We need to add a new reference page giving usage information and examples.



 Comments   
Comment by Githook User [ 22/Nov/16 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-8144 : fix bad copy+paste
Branch: master
https://github.com/mongodb/docs/commit/2953cca87953fef4dbe2a5bfb86f975b5c6bb8db

Comment by Githook User [ 22/Nov/16 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-8144 count is a pipeline not expression
Branch: master
https://github.com/mongodb/docs/commit/4c965044067978baa909a0c90c559f5271036427

Comment by Githook User [ 11/Nov/16 ]

Author:

{u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}

Message: DOCS-8144: updates to $count example
Branch: master
https://github.com/mongodb/docs/commit/70ac4e1e545e77dfcb229f1d3afcd27c3e9d579f

Comment by Githook User [ 11/Nov/16 ]

Author:

{u'username': u'steveren', u'name': u'Steve Renaker', u'email': u'steve.renaker@mongodb.com'}

Message: DOCS-8144: $count aggregation stage

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/7b9c63e98760caa8d30c2ce250c8b5df0b015ec6

Comment by Asya Kamsky [ 11/Nov/16 ]

this stage is not listed in the 3.4 release notes anywhere.

Comment by Robert Stam [ 30/Sep/16 ]

To be more precise, I think that:

{ $count : "count" }

is actually syntactic sugar for:

{ $group : { _id : null, count : { $sum : 1 } } }
{ $project : { _id : 0 } }

Without the $project the results would be different.

Generated at Thu Feb 08 07:55:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.