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

Filtering timeseries with date-field does not include results from before 1970

    • Fully Compatible
    • ALL
    • v6.0, v5.0
    • Hide
      • Create a time-series collection
      • Insert records before and after epoch
      • Query for documents with filter: { $timeField: { $lt: "arbitrary date > 1970" }

        }

      • Results will only include documents after epoch

       

      If you query with { $timeField:

      { $lt: "arbitrary date < 1970" }

      }, the documents missing from the previous set will suddenly show up.

      Show
      Create a time-series collection Insert records before and after epoch Query for documents with filter: { $timeField: { $lt: "arbitrary date > 1970" } } Results will only include documents after epoch   If you query with { $timeField: { $lt: "arbitrary date < 1970" } }, the documents missing from the previous set will suddenly show up.
    • QO 2022-09-19, QO 2022-10-03

      db['test-array-ts'].countDocuments({
        date: { $lt: ISODate('1970-01-01T18:31:22.000+00:00') }
      })
      result: 149
      db['test-array-ts'].countDocuments({
        date: { $lt: ISODate('1965-01-01T18:31:22.000+00:00') }
      })
      result: 1989943

            Assignee:
            joel.redman@mongodb.com Joel Redman (Inactive)
            Reporter:
            steve25070@gmail.com Stefan de Jong
            Votes:
            0 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: