[DOCS-3988] Comment on: "manual/reference/sql-aggregation-comparison.txt" Created: 03/Sep/14  Updated: 03/Nov/17  Resolved: 03/Sep/14

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: 01112017-cleanup

Type: Improvement Priority: Major - P3
Reporter: Deepak Assignee: Unassigned
Resolution: Done Votes: 0
Labels: collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mac osx

Location: http://docs.mongodb.org/manual/reference/sql-aggregation-comparison/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.78.2 (KHTML, like Gecko) Version/6.1.6 Safari/537.78.2
Screen Resolution: 1920 x 1080
repo: docs
source: reference/sql-aggregation-comparison


Participants:
Days since reply: 9 years, 24 weeks ago

 Description   

Document says the equivalent of select count from orders is as under:
db.orders.aggregate( [
{
$group: {
_id: null,
count:

{ $sum: 1 }

}
}
] )

My question is that db.orders.count() gives me the same answer. A lot simpler.



 Comments   
Comment by Deepak [ 03/Sep/14 ]

Thank you!

No trees were harmed while sending this message, however a lot of electrons were terribly inconvenienced.

Comment by Sam Kleinman (Inactive) [ 03/Sep/14 ]

this resource is intended to showcase the aggregation framework in potentially composable units, so the current example makes sense.

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