Disallow $documents with $_resumeAfter or $_startAt

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • 8.2.13, 8.3.8, 9.0.0-rc2
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • ALL
    • v9.0, v8.3, v8.2, v8.0, v7.0
    • Hide
      const pipeline = [{$documents: [{x: 1}]}];
      assert.commandWorked(db.runCommand({aggregate: 1, pipeline, cursor: {}}));
      assert.commandFailed(db.runCommand(
          {aggregate: 1, pipeline, cursor: {}, $_resumeAfter: {$recordId: NumberLong(1)}}));
      assert.commandFailed(
          db.runCommand({aggregate: 1, pipeline, cursor: {}, $_startAt: {$recordId: NumberLong(1)}})); 
      Show
      const pipeline = [{$documents: [{x: 1}]}]; assert .commandWorked(db.runCommand({aggregate: 1, pipeline, cursor: {}})); assert .commandFailed(db.runCommand(     {aggregate: 1, pipeline, cursor: {}, $_resumeAfter: {$recordId: NumberLong(1)}})); assert .commandFailed(     db.runCommand({aggregate: 1, pipeline, cursor: {}, $_startAt: {$recordId: NumberLong(1)}}));
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We should lock this behavior out; the doc comments above _startAt and _resumeAfter state "Must only be set on forward collection scans." Of course, $documents has no collection.

            Assignee:
            Evan Bergeron
            Reporter:
            Evan Bergeron
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: