我正在使用 Mongo 2.2 。如何使用C#访问查询信息?
目前有以下内容来获取我的数据:
var records = _collection.Find(filters).ToList<Vehicle>();
我试图在我的查询结束时类似地将.explain()添加到Robomongo中我可以做的事情:
var records = _collection.Find(filters).explain();
然而,它不存在,我相信因为它不是光标。有谁知道如何在C#中获取此查询数据?
答案 0 :(得分:0)
由MongoCollection类的FindAs()方法产生的MongoCursor类的.Explain()方法。我从this link找到了答案。
var qLinq = Query<T>.Where(x => x.name=="jim");
var exp = Collection.FindAs<T>(qLinq).Explain()