Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-8673

Clicking "Format" button does not result in valid JSON inside Partial Filter Expression editor.

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Environment:
      OS: MacOS 14.4 (23E214)
      node.js / npm versions: NA
      Additional info:
    • 3
    • Developer Tools

      Problem Statement/Rationale

      When creating a new index with a Partial Filter Expression from the Compass GUI, if you click "format", the resulting JSON will not be valid because it removes quotes around single word fields.

      Please be sure to attach relevant logs with any sensitive data redacted.
      Please see attached screen capture.

      Steps to Reproduce

      1. Click Create -> Index to open the "Create Index" modal in Compass
      2. Expand options then check "Partial Filter Expression"
      3. Paste in some valid JSON like `{ "foo": "bar" }`
      4. Click the Format button in the top right of the text area
      5. Notice the double quotes around `"foo"` are removed resulting in invalid JSON: `{ foo: "bar" }`
      6. Click "Create Index" and note the failure toast.

      Expected Results

      The Format button formats as valid JSON within fields that require it.

      Actual Results

      The Format button formats to a JS object, not valid JSON, even if the content was previously valid JSON.

      Additional Notes

      I love using Compass! Thanks for all the hard work!

            Assignee:
            Unassigned Unassigned
            Reporter:
            nick@grocerslist.com Nick Leoutsakos
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: