-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: 1.42.3
-
Component/s: None
-
None
-
Environment:OS: MacOS 14.2.1
Problem Statement/Rationale
In MongoDB Compass, when inputting a valid JSON object into the partialFilterExpression field for index creation, using the UI's "format" button results in the automatic removal of quotation marks from JSON keys. This behavior transforms the JSON from a valid format to an invalid one. Specifically, after entering a correct JSON structure with quotation marks around keys and string values (as required by JSON standards) and then clicking the "format" button, the formatted JSON erroneously lacks quotation marks around the keys.
Attempting to proceed with the index creation after formatting results in a syntax error: "Bad PartialFilterExpression: SyntaxError: Expected property name or '}' in JSON at position 4 (line 2 column 3)." This issue suggests a bug in the formatting function that affects usability, particularly for creating indexes with partial filter expressions directly through the UI. The desired action is for the Engineering team to correct the formatting feature to preserve the validity of JSON structures, including retaining quotation marks where they are necessary.
Or if it is supposed to be a plain object, then an error should not be thrown on valid plain object and JSON format should not be accepted. I am not sure of the intended behavior and regardless a consistent, working behavior is expected.
Please be sure to attach relevant logs with any sensitive data redacted.
How to retrieve logs for: Compass; Shell
Steps to Reproduce
Please see the attached screen recording.
Expected Results
I expect Compass accepts the formatting it performs.
Actual Results
Compass fails to accept its own formatting and instead I have to manually add quotation marks around the keys of the expression.
Additional Notes
–