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

Passing explain option to aggregation framework doesn't work with shell helper

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.6.0-rc0
    • Component/s: Aggregation Framework
    • ALL
    • Hide

      See above

      Show
      See above
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      Problem:
      Based on the doc
      http://docs.mongodb.org/master/reference/method/db.collection.aggregate/#db.collection.aggregate

      Passing in the explain option causes the following

      > db.sbtest5.aggregate({ $match: { _id: { $gte: 407091, $lte: 407190 } } }, { $project: { k: 1 , _id: 0 } }, { $group: { _id: null, average: { $sum: "$k" } } }, {explain:true})
      assert: command failed: {
      	"errmsg" : "exception: Unrecognized pipeline stage name: 'explain'",
      	"code" : 16436,
      	"ok" : 0
      } : aggregate failed
      Error: command failed: {
      	"errmsg" : "exception: Unrecognized pipeline stage name: 'explain'",
      	"code" : 16436,
      	"ok" : 0
      } : aggregate failed
          at Error (<anonymous>)
          at doassert (src/mongo/shell/assert.js:11:14)
          at Function.assert.commandWorked (src/mongo/shell/assert.js:244:5)
          at DBCollection.aggregate (src/mongo/shell/collection.js:1098:12)
          at (shell):1:12
      2014-02-27T09:57:34.905-0800 Error: command failed: {
      	"errmsg" : "exception: Unrecognized pipeline stage name: 'explain'",
      	"code" : 16436,
      	"ok" : 0
      } : aggregate failed at src/mongo/shell/assert.js:13
      

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            alvin Alvin Richards (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: