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

Aggregation cursor rejects unknown options

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.5.3
    • Component/s: Aggregation Framework
    • ALL
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      > 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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            bjori Hannes Magnusson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: