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

Time searches in timeseries collections not yielding results

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 7.0.14
    • Component/s: None
    • None
    • Environment:
      OS: Ubuntu 24.04
      node.js / npm versions: NA
      Additional info: mongod version 7.0.14
    • ALL
    • Hide

      I have created a test collection, inserted data, and found that this is not happening.  It may be a symptom that only comes from higher document count collections.

      Show
      I have created a test collection, inserted data, and found that this is not happening.  It may be a symptom that only comes from higher document count collections.

      Problem Statement/Rationale

      Time based searches in timeseries collections are not providing expected results.

      Please be sure to attach relevant logs with any sensitive data redacted.
      How to retrieve logs for: Compass; Shell

      Steps to Reproduce

      Insert data into a timeseries collection, query it using $gt, $gte, and $eq operands.

      Expected Results

      Results should have been returned.

      Actual Results

      No documents were returned.

      Additional Notes

      ```

      testDB> db.TS_Stuff.count()

      131553179
      testDB> db.getCollectionInfos({name:'TS_Stuff'})
      [
      {
      name:'TS_Stuff',
      type:'timeseries',
      options: {
      timeseries:

      { timeField:'t', metaField:'d', granularity:'seconds', bucketMaxSpanSeconds:3600 }

      },
      info: { readOnly:false }
      }
      ]

      testDB> db.TS_Stuff.find({},{_id:0,t:1}).sort({t:-1}).limit(5)
      [

      { t: ISODate('2024-07-24T14:32:18.000Z') }

      ,

      { t: ISODate('2024-07-24T14:32:16.000Z') }

      ,

      { t: ISODate('2024-07-24T14:32:16.000Z') }

      ,

      { t: ISODate('2024-07-24T14:32:14.000Z') }

      ,

      { t: ISODate('2024-07-24T14:32:14.000Z') }

      ]

      testDB> db.TS_Stuff.find({t:{$gte:ISODate('2024-07-24T14:32:16.000Z')}},{_id:0,t:1})

      testDB> db.TS_Stuff.find({t:{$gt:ISODate('2024-07-24T14:32:16.000Z')}},{_id:0,t:1})

      testDB> db.TS_Stuff.find({t:{$eq:ISODate('2024-07-24T14:32:16.000Z')}},{_id:0,t:1})

      testDB> db.TS_Stuff.find({t:{$lt:ISODate('2024-07-24T14:32:16.000Z')}},{_id:0,t:1})
      [

      { t: ISODate('2017-10-24T21:16:15.000Z') }

      ,

      { t: ISODate('2017-10-24T21:16:16.000Z') }

      ,
      ...17 entries

      { t: ISODate('2017-10-24T21:16:38.000Z') }

      ]
      Type "it" for more

      testDB> db.TS_Stuff.find({t:{$lte:ISODate('2024-07-24T14:32:16.000Z')}},{_id:0,t:1})
      [

      { t: ISODate('2017-10-24T21:16:15.000Z') }

      ,

      { t: ISODate('2017-10-24T21:16:16.000Z') }

      ,
      ...17 entries

      { t: ISODate('2017-10-24T21:16:38.000Z') }

      ]
      Type "it" for more```

        1. image-2024-10-24-10-09-10-925.png
          image-2024-10-24-10-09-10-925.png
          28 kB
        2. db.txt
          3 kB

            Assignee:
            chris.kelly@mongodb.com Chris Kelly
            Reporter:
            hosein@hosein.nyc Hosein Babai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: