[SERVER-40530] Comment option in aggregation does not seem to produce effect Created: 08/Apr/19 Updated: 09/Apr/19 Resolved: 09/Apr/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 3.6.12 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Dani | Assignee: | Eric Sedor |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Steps To Reproduce: | Mongo 3.6 db.setProfilingLevel(2);db.movies.insert({ "title" : "Jaws", "year" : 1995, "imdb" : "tt0073195" }); The aggregation
{{db.movies.aggregate( [ { $match: { year : 1995 }} ], { comment : "year_95_query" } );}}
is shown in system.profile as follows: {{}}{{{ }} } ], }}
Where the old $comment in a $match stage
{{db.movies.aggregate( [ { $match: { year : 1995, $comment : "year_95_query" }} ] );}}
is shown as:
{{{ }} } ], }} |
| Participants: |
| Description |
|
The docs say the comment option's string should appear like this: }
But the comment string is nowhere to be seen in system.profile |
| Comments |
| Comment by Eric Sedor [ 09/Apr/19 ] | |||||||||||||||||||||||||||||||||||||||||||
|
Understood Dani, and no problem! | |||||||||||||||||||||||||||||||||||||||||||
| Comment by Dani [ 09/Apr/19 ] | |||||||||||||||||||||||||||||||||||||||||||
|
Ok, it's MongoDB 3.6.8 but never mind. Tested again from the real mongo shell this time and you're right, it works as expected. I was working from the shell in Studio 3T and it doesn't work from there. Really weird since it's configured to use the real mongo binary from the brew install directory /usr/local/Cellar/mongodb@3.6/3.6.8_1/bin/mongo but I'll take it up with them. Dani | |||||||||||||||||||||||||||||||||||||||||||
| Comment by Eric Sedor [ 09/Apr/19 ] | |||||||||||||||||||||||||||||||||||||||||||
|
This documentation shows how to provide comments within the aggregation framework, while this documentation describes how to provide a comment as a command option. We have not been able to reproduce the omission of either form in a system.profile collection in MongoDB 3.6.12. Can you let us know if this omission is recurring in a specific maintenance release of 3.6.X?
| |||||||||||||||||||||||||||||||||||||||||||
| Comment by Dani [ 09/Apr/19 ] | |||||||||||||||||||||||||||||||||||||||||||
|
I messed up the output of the $comment in
Should read like this:
|