MongoDB - can't use .explain() to get query info in C# code?

前端 未结 1 1594
我在风中等你
我在风中等你 2021-01-19 20:55

I\'m using Mongo 2.2. How can I access the query info using C#?

Currently have the following to get my data:

 var records = _collect         


        
1条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-19 21:34

    There is .Explain() method of MongoCursor class resulting from FindAs() method of MongoCollection class. I found an answer from this link.

    var qLinq = Query.Where(x => x.name=="jim");
    
    var exp = Collection.FindAs(qLinq).Explain()
    

    0 讨论(0)
提交回复
热议问题