Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-18881

Limit with explain("executionStats") has limitAmount as 0

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.1.5
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Fully Compatible
    • ALL
    • Hide

      Run the following

      db.limit_test.insert([{a:1},{a:2}])
      db.limit_test.find().limit(1).explain()
      db.limit_test.find().limit(1).explain("executionStats")
      

      The explain() will show limitAmount of 1
      The explain("executionStats") will show limitAmount of 0

      Show
      Run the following db.limit_test.insert([{a:1},{a:2}]) db.limit_test.find().limit(1).explain() db.limit_test.find().limit(1).explain( "executionStats" ) The explain() will show limitAmount of 1 The explain("executionStats") will show limitAmount of 0
    • RPL 5 06/26/16

      When a query with a limit is executed with a simple explain, it shows limitAmount as the user specified limit. When it is executed with explain("executionStats"), it always shows limitAmount as 0.

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: