MongoDB笔记十一——count+Distinct+Group
1、count()
查询出国籍是美国的学生人数
![MongoDB笔记十一——count+Distinct+Group](https://app.yinxiang.com/shard/s22/res/665b26e5-a5e6-4d96-9d70-fc5e01808c13.png)
![MongoDB笔记十一——count+Distinct+Group](https://app.yinxiang.com/shard/s22/res/b8576ad8-2f51-45d1-85e2-3de933a2ef6d.png)
![MongoDB笔记十一——count+Distinct+Group](https://app.yinxiang.com/shard/s22/res/665b26e5-a5e6-4d96-9d70-fc5e01808c13.png)
2、Distinct()
查询出都有哪些国家的学生
db.runCommond({distinct:"persons",key:"country"}).values
![MongoDB笔记十一——count+Distinct+Group](https://app.yinxiang.com/shard/s22/res/b8576ad8-2f51-45d1-85e2-3de933a2ef6d.png)
当前题目:MongoDB笔记十一——count+Distinct+Group
文章出自:http://pcwzsj.com/article/jiiico.html