Disallow streaming group on time-series collection when other field is projected to time field

XMLWordPrintableJSON

    • Query Integration
    • ALL
    • Hide
      const coll = db.coll;
      assert(coll.drop());
      assert.commandWorked(db.createCollection(coll.getName(), {timeseries: {timeField: "t"}}));
      
      assert.commandWorked(coll.insert([{t: new Date(), a: null}, {t: new Date(), a: 0}]))
      
      coll.aggregate([{$addFields: {t: "$a"}}, {$sort: {t: 1}}, {$group: {_id: "$t"}}]).toArray()
      // uassert: Monotonic value should not be missing, null or an array
      
      Show
      const coll = db.coll; assert (coll.drop()); assert .commandWorked(db.createCollection(coll.getName(), {timeseries: {timeField: "t" }})); assert .commandWorked(coll.insert([{t: new Date(), a: null }, {t: new Date(), a: 0}])) coll.aggregate([{$addFields: {t: "$a" }}, {$sort: {t: 1}}, {$group: {_id: "$t" }}]).toArray() // uassert: Monotonic value should not be missing, null or an array
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The repro shows that we accidentally use streaming group when the time field is renamed, even though we no longer have guarantees that it won't be null/missing/array. It throws a uassert here, and the check that the sort is on the time field is here

              Assignee:
              Unassigned
              Reporter:
              Matt Boros
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: