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

Time-series bucket min/max does not track empty field names under certain circumstances

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0, 5.0.27, 7.0.9, 7.3.2, 6.0.16
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Fully Compatible
    • ALL
    • v7.3, v7.0, v6.0, v5.0
    • Execution Team 2024-03-04

      When a document inserted into a time-series collection contains a field which has a empty field name, and that document does not specify a value for the collection's meta field, then the field with the empty field name does not get tracked by the bucket's min/max.

      const coll = db.coll;
      const bucketsColl = db.system.buckets.coll;
      
      assert.commandWorked(
          db.createCollection(coll.getName(), {timeseries: {timeField: "t", metaField: "m"}}));
      assert.commandWorked(coll.insert({t: ISODate(), _id: 0, "": 0}));  // note that no "m" is provided
      const bucket = bucketsColl.find().toArray()[0];
      assert(bucket.control.min.hasOwnProperty(""), bucket);  // this assertion fails
      assert(bucket.control.max.hasOwnProperty(""), bucket);  // this assertion fails 

            Assignee:
            gregory.noma@mongodb.com Gregory Noma
            Reporter:
            gregory.noma@mongodb.com Gregory Noma
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: