//官方文档
https://docs.mongodb.com/manual/
http://www.tuicool.com/articles/2iqUZj
http://www.runoob.com/mongodb/mongodb-aggregate.html
http://www.cnblogs.com/AlvinLee/p/6085442.html
https://docs.mongodb.com/manual/reference/method/db.collection.distinct/
mongod.exe --dbpath C:Environmongodb-3.0.7datadb
http://www.cnblogs.com/ontheroad_lee/p/3756247.html
https://segmentfault.com/a/1190000004263347
var group = new BsonDocument { { "$group", new BsonDocument { { "_id", new BsonDocument { {"Age","$Age"} ,{"Sex","$Sex" } }}, {"Count", new BsonDocument{ { "$sum", 1 } } } } } }; var pipeline = new[] { group }; var result = collection.Aggregate(pipeline);