Data Explorer: Query Generator generates queries with $date instead of ISODate

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Environment:
      OS:
      node.js / npm versions:
      Additional info:
    • 3
    • None
    • None
    • Developer Tools

      Related to HELP-97039

      Let's update the prompt for the query/aggregation generation to be explicit about the expected format: shell syntax and ISODate() for dates. Let's check if the existing evals cover this, and if not let's cover it.

      Problem Statement/Rationale

      What is going wrong? What action would you like the Engineering team to take?

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

      Steps to Reproduce

      Repro steps:

      1. In the Atlas UI, use the Query Generator to filter records by a date field after a given timestamp.
      2. Run the generated query in the Atlas Data Explorer query bar against a collection with matching documents. Sometimes it will generate a query with $date and sometimes with ISODate
      3. Observe zero results despite qualifying records existing.

      Expected Results

      For queries intended to run in Atlas Data Explorer, the Query Generator should emit a valid date literal such as ISODate() rather than $date.

      Customer impact:
      From the customer: “This is a silent failure - the query runs successfully and returns an empty result set, which can easily be mistaken for "no matching data" rather than a malformed query. That makes it particularly likely to cause incorrect conclusions.”

      Actual Results

      Data Explorer Query Generator is generating queries with $date instead of ISODate() for date filters intended to run in Atlas Data Explorer.

      Example for sample_mflix.movies: screenshots attached

      Find the movie released on or after 1903-12-01T00:00:00.000Z
      sometimes: {released:{$gte:{$date: '1903-12-01T00:00:00.000Z'}}}
      sometimes: {released:{$gte:ISODate('1903-12-01T00:00:00.000Z')}}

      javascript

      When the query with $date is run in the Atlas Data Explorer query bar, it executes successfully but returns an empty result set even when matching documents exist.

      Additional Notes

      Any additional information that may be useful to include.

            Assignee:
            Unassigned
            Reporter:
            Eduarda Scharnhorst
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: