[DOCS-3376] Comment on: "manual/tutorial/aggregation-zip-code-data-set.txt" Created: 09/May/14 Updated: 08/Dec/16 Resolved: 25/Jul/14 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | manual |
| Affects Version/s: | None |
| Fix Version/s: | v1.3.8 |
| Type: | Improvement | Priority: | Blocker - P1 |
| Reporter: | Docs Collector User (Inactive) | Assignee: | Kay Kim (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | collector-298ba4e7 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Location: http://docs.mongodb.org/manual/tutorial/aggregation-zip-code-data-set/ |
||
| Participants: | |
| Days since reply: | 9 years, 29 weeks, 5 days ago |
| Description |
|
Hello. About the example "Return Average City Population by State" I spent a lot of time figuring out why the query was so complex. I had to analyze the dataset to see that cities can have the same name in the same state. Maybe it is obvious for americans but not really for foreign people like me I think it should me mentioned somewhere that we need to group on state AND cities because 2 cities can have the same name, in the same state. db.collection.aggregate([{$group: { _id: "$state", average: {$avg: "$pop" }}}]) Michel |
| Comments |
| Comment by Kay Kim (Inactive) [ 25/Jul/14 ] |
|
Add note that a city can have more than one zip code. |
| Comment by Githook User [ 25/Jul/14 ] |
|
Author: {u'username': u'kay-kim', u'name': u'kay', u'email': u'kay.kim@10gen.com'}Message: |