History in the query input box removes comments from the query

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • No version
    • Affects Version/s: 1.48.2
    • Component/s: None
    • None
    • Environment:
      OS:MacOS 26.1 (25B78)
      Compass : 1.48.2 (1.48.2)
    • Not Needed
    • None
    • Developer Tools

      Problem Statement/Rationale

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

      Steps to Reproduce

      How could an engineer replicate the issue you’re reporting?

      Type a query into the input box say

      {
        user_id: ObjectId(
          "67adf4ebc6ac9b24daebd16e"
        ),
        created_at: {
          $gte: ISODate("2025-07-11T18:30:00.000Z")
        },
        tags: { $exists: true, $ne: [] },
      }
      

      Now comment one of the lines in this guery and run it.

      {
        user_id: ObjectId(
          "67adf4ebc6ac9b24daebd16e"
        ),
        created_at: {
          $gte: ISODate("2025-07-11T18:30:00.000Z")
        },
        // tags: { $exists: true, $ne: [] },
      } 

      Once done with this remove the query from the input box and try to select it using the quick history. It will give the below as your query

       

      {
        user_id: ObjectId("67adf4ebc6ac9b24daebd16e"),
        created_at: {
          $gte: ISODate("2025-07-11T18:30:00.000Z")
        }
      } 

       

      The Expected Results

      What do you expect to happen?

      This should not happen, If I run a query with a lot of commented filters, I'll loose them all.

      Additional Notes

      Any additional information that may be useful to include.

      If this is taken up as a issue to work on and you accept external PR's. I would like to work on it

            Assignee:
            Unassigned
            Reporter:
            Kushagra S N/A
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: