Run the Explain command on a db Find

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.0
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Using the new C# 2.0 driver, I cannot seem to figure out how to run an Explain query.

      An example query is:

      
      var obj = await someCollection.Find(Builders<SomeType>.Filter.Eq("field", "value")).FirstOrDefaultAsync();
      

      someCollection is of type IMongoCollection<SomeType>.
      the Find command returns an IFindFluent<SomeType,SomeType> but this object has no Explain() method.

      I am importing the following namespaces:

      using MongoDB.Bson;
      using MongoDB.Driver;
      

      I am trying to do this without using the legacy driver but cannot figure out how to do it even with the legacy driver without creating a legacy connection since my Database connection returns an IMongoDatabase and none of the find options returns a MongoQuery.

            Assignee:
            Craig Wilson
            Reporter:
            Peter Gordon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: