[SERVER-6768] MongoDB Profiler creates illegal documents Created: 14/Aug/12 Updated: 06/Dec/22 Resolved: 19/Oct/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Diagnostics |
| Affects Version/s: | 2.0.4, 2.6.4, 2.7.6 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Sean Coates | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Done | Votes: | 1 |
| Labels: | profiling | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux (Debian). N/A, really. |
||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Assigned Teams: |
Query
|
||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Description |
|
The DB profiler creates illegal documents. These documents contain: This problem makes working with these documents incredibly difficult. Here's an example:
The same thing happens for $orderby, $or, $set, etc., as well as for keys with "." in the name. I think the profiler should not create documents that can't be inserted. (I had to insert them into another collection because I wanted to filter the profiler data set, but I can't delete from a capped collection, which db.system.profile is.) I realize this changes the data format of the profiler, but it seems like the right move to me. — As a workaround, for those developers who might stumble upon this, I managed to get the following transposition to work, but it's far from ideal:
(I also couldn't get this box to respect wiki markup, so editor: feel free to fix.) [Done.] |
| Comments |
| Comment by Katya Kamenieva [ 26/Oct/20 ] | ||||||||||||||||||
|
Thanks for more details, david.storch, I linked SERVER-30575 to this ticket. As you said, querying fields with "." and "$" should be improved, and there is no plan to stop using "." and "$" in the fields of system.profile. | ||||||||||||||||||
| Comment by David Storch [ 26/Oct/20 ] | ||||||||||||||||||
|
kateryna.kamenieva, one clarification: I believe that the server still rejects the "." and "$" characters in some scenarios. We have open tickets which would remove those guardrails in more cases (see
Is the reasoning for closing this ticket that, due the schema of the system.profile collection, it is impossible to create a document in the profile collection which has a $-prefixed top-level field? Regardless of the answer to this question, I do agree that it makes sense to close this ticket and instead improve the query language so that it can express queries over documents with "$" and "." in the keyname (tracked by SERVER-30575). | ||||||||||||||||||
| Comment by Katya Kamenieva [ 19/Oct/20 ] | ||||||||||||||||||
|
Starting 3.6 field names with "." and "$" are allowed. Here is section in docs. |