[SERVER-8497] Javascript shell does not escape quotes in field names Created: 11/Feb/13 Updated: 26/Oct/21 Resolved: 26/Oct/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Trivial - P5 |
| Reporter: | Shaun Verch | Assignee: | Geert Bosch |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
| Comments |
| Comment by Geert Bosch [ 26/Oct/21 ] | ||||||||||||||||
|
Looks like this now works with mongosh:
| ||||||||||||||||
| Comment by Tad Marshall [ 11/Feb/13 ] | ||||||||||||||||
|
Agreed. See src/mongo/shell/types.js line 596:
This line adds quotes around the field name (k) without making any effort to quote special characters in it.
Seems like changing it to this fixes it:
| ||||||||||||||||
| Comment by Shaun Verch [ 11/Feb/13 ] | ||||||||||||||||
|
I think this is actually a separate issue from what Scott mentioned and | ||||||||||||||||
| Comment by Tad Marshall [ 11/Feb/13 ] | ||||||||||||||||
|
Re: scotthernandez's comment: Is this the same issue as | ||||||||||||||||
| Comment by Scott Hernandez (Inactive) [ 11/Feb/13 ] | ||||||||||||||||
|
It seems like quoting/escaping is a bit worse that that:
|