摘要: String to BsonDocument string json = "{ 'foo' : 'bar' }"; MongoDB.Bson.BsonDocument document = MongoDB.Bson.Serialization.BsonSerializer.Deserialize(json); BsonDocument to json string. BsonDocume... 阅读全文
posted @ 2018-01-24 17:06 今夜太冷 阅读(12982) 评论(0) 推荐(3) 编辑
摘要: 首先是数据的录入,为了分析我们服务器集群的性能,需要准备大量的用户数据,幸运的是mtools提供了mgenerate方法供我们使用。他可以根据一个数据模版向 MongoDB 中插入任意条 json 数据。下面的 json 结构是我们在例子中需要使用的数据模版: { "user": { "name": { "first": {"$choose": ["Liam", "Aubre... 阅读全文
posted @ 2018-01-24 15:34 今夜太冷 阅读(477) 评论(0) 推荐(0) 编辑