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

Improve error messages for aggregation expressions

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.0-rc0
    • Component/s: Aggregation Framework
    • Query Optimization

      Currently, when an expression encounters an error, the pipeline fails, and gives some information about why it failed, but no information about which document caused it to fail:

      2015-11-02T15:35:28.142-0500 E QUERY    [thread1] Error: command failed: {
      	"ok" : 0,
      	"errmsg" : "$arrayElemAt's first argument must be an array, but is NumberDouble",
      	"code" : 28689
      } : aggregate failed :
      _getErrorWithCode@src/mongo/shell/utils.js:23:13
      doassert@src/mongo/shell/assert.js:13:14
      assert.commandWorked@src/mongo/shell/assert.js:259:5
      DBCollection.prototype.aggregate@src/mongo/shell/collection.js:1211:5
      

      It may be that most of your documents had the expected structure, but a select few have a different structure, causing the error. To make it easier to track down which was the offending document, the error message should include the document that was being processed when the error occurred.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: