[COMPASS-896] Document how Compass handles special escape sequences in input fields Created: 10/Mar/17 Updated: 10/Jan/24 Resolved: 30/Jun/22 |
|
| Status: | Closed |
| Project: | Compass |
| Component/s: | CRUD, Query |
| Affects Version/s: | 1.6.0 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Aleksey Savateyev | Assignee: | Unassigned |
| Resolution: | Won't Do | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Story Points: | 5 | ||||||||||||
| Description |
Original Bug Report1. Try to insert the doc with double backslash in one of the values, for example {User: "DOMAIN\\someuser"}2. Try to query for value containing two backslashes Task on this ticket
Freetext String Input FieldsDocument current behavior of "Insert Document" input handling of special character sequences, including
See e.g. Single Character Escape Sequences in JavaScript. Document what was inserted, how it is stored in MongoDB (e.g. inspection via mongo shell or mongoexport) and how it is displayed in Compass. Fields to check:
For example, for Query Bar: Future WorkBased on the outcome of the reproduction and documentation of current behavior, we can make a decision on what the desired behavior should be and create appropriate tickets to implement this. For example:
Further Resources and Tools
|
| Comments |
| Comment by Jessica Sigafoos [ 30/Jun/22 ] |
|
Thank you for your feedback! If this issue is still relevant to you, please vote on or file a feature request at https://feedback.mongodb.com/ |
| Comment by Vladimír Čamaj [ 21/Nov/18 ] |
|
Hi, problem with escape slash also appears in using regular expressions. This regexp {"publishDate": {$regex: '^\d{4} |
| Comment by Thomas Rueckstiess [ 13/Mar/17 ] |
|
lucas.hrabovsky agree we need more reproduction and docu, but moving it back to "Needs Triage" won't get the work done. If that's what we need, let's put that in the ticket and make it actionable. Update: done. |
| Comment by Sam Weaver [ 13/Mar/17 ] |
|
Do you guys need me or Aleksey to provide more info here? |
| Comment by Lucas Hrabovsky (Inactive) [ 13/Mar/17 ] |
|
thomasr the difference is that the query bar currently uses JSON whereas CRUD does not. This is a tricky case to handle as double backslash is itself a special character. I've moved this back into "Needs Triage" as I believe more thorough reproduction steps need to be included and documentation of existing behavior. |
| Comment by Thomas Rueckstiess [ 13/Mar/17 ] |
|
It seems that Compass uses both above interpretations inconsistently in different areas. CRUD (insert/read document) seems to use literal interpretation, while the Query Bar seems to use the special character interpretation. This also explains why the document can't be found any more when searching for double backslashes. You would need 4 backslashes to find it again. |
| Comment by Thomas Rueckstiess [ 13/Mar/17 ] |
|
sam.weaver, we don't know what the actual behavior should be. There are two choices:
|
| Comment by Sam Weaver [ 10/Mar/17 ] |
|
Actually, this is a different bug. Compass can't handle slashes in values properly. Example: Value in shell: { "_id" : ObjectId("58c319a69b8e353d7773f362"), "user" : "DOMAIN\\sam" }Value in Compass is shown as only having a single slash instead of a double slash: Searching for {user:"DOMAIN\\sam"}in the compass query bar returns the document showing a single slash which is confusing. More confusing is that if I insert a document with a double slash in Compass UI, it is stored with 4 slashes in the server: { "_id" : ObjectId("58c31929dfc14c1c48bd9fc0"), "user" : "DOMAIN\\\\user" } |
| Comment by Aleksey Savateyev [ 10/Mar/17 ] |
|
IN the second step I meant searching for any text containing double backslash. |