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

Aggregation cursor rejects unknown options

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.5.3
    • Aggregation Framework
    • ALL

    Description

      > db.messages.aggregate([ ], { cursor: { foo: 1} })
      assert: command failed: {
      	"errmsg" : "exception: cursor object can't contain fields other than batchSize",
      	"code" : 16955,
      	"ok" : 0
      } : aggregate with cursor failed
      Error: Printing Stack Trace
          at printStackTrace (src/mongo/shell/utils.js:38:15)
          at doassert (src/mongo/shell/assert.js:6:5)
          at Function.assert.commandWorked (src/mongo/shell/assert.js:238:5)
          at DBCollection.aggregate (src/mongo/shell/collection.js:907:12)
          at (shell):1:13
      2013-10-16T13:46:07.155-0700 command failed: {
      	"errmsg" : "exception: cursor object can't contain fields other than batchSize",
      	"code" : 16955,
      	"ok" : 0
      } : aggregate with cursor failed at src/mongo/shell/assert.js:7

      This means that when we add new cursor option in later releases it'll be very annoying for drivers to handle and they'd need to wash the options first.

      We've shot ourself in the foot before by doing this sort of validation which prohibits future improvements.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bjori Hannes Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: