BsonDocument

http://api.mongodb.com/csharp/current/html/T_MongoDB_Bson_BsonDocument.htm

 

如何取出document中的数据

BsonDocument book;
string author = book["author"].AsString;
DateTime publicationDate = book["publicationDate"].AsDateTime;
int pages = book["pages", -1].AsInt32; // default value is -1

posted @ 2017-03-02 15:18  ChuckLu  阅读(1544)  评论(0编辑  收藏  举报