How use explain in c# driver 2.19

In version 2.15, the ability to set explain modifier was removed. How use explain in c# driver 2.19?

1 Like

Oh my God. I am also very concerned about this issue! Mr. Traxel, answer me if you are get an answer

Hi, @via96,

Welcome to the MongoDB Community Forums. I understand that you’re having trouble with explaining queries with recent versions of the .NET/C# Driver.

To explain commands in the 2.x API, we recommend creating an explain command using BsonDocument and executing it via the RunCommand helper.

The legacy 1.x API does have MongoCursor.Explain(bool verbose). Reviewing the source code between v2.14.x and v2.19.x, I do not see any changes to Explain. NOTE: We do not recommend using the legacy 1.x API anymore as it will be removed in the next major release.

If you can provide code examples that work in versions prior to v2.15, but do not work now, we can investigate further.


This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.