[CSHARP-1541] Add support for $comment for profiling Created: 21/Jan/16 Updated: 03/Mar/22 Resolved: 25/Feb/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Diagnostics, Operations |
| Affects Version/s: | 2.2.2 |
| Fix Version/s: | 2.15.0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Aristarkh Zagorodnikov | Assignee: | Boris Dogadov |
| Resolution: | Done | Votes: | 5 |
| Labels: | size-medium | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Description |
|
I see that the $comment partially made its way into the driver in the form of the "Comment" field for FindOptions. I believe it would be logical to extend its support for other cases that contain queries (updates, FindAndWhatever, aggregation). P.S. |
| Comments |
| Comment by Githook User [ 25/Feb/22 ] |
|
Author: {'name': 'Boris', 'email': 'boris.dogadov@mongodb.com', 'username': 'BorisDog'}Message: |
| Comment by Aristarkh Zagorodnikov [ 16/May/20 ] |
|
The lack of support for $comment in findAnd* commands makes implementing a robust end-to-end tracing solution impossible. Any chances this will make into some future release? |
| Comment by Robin Munn [ 06/Sep/16 ] |
|
I am currently trying to track down an error in a C# application that uses MongoDB queries, and I'm seeing lots of "$msg" : "query not recording (too large)" entries in the Mongo log. A Google search led me to http://grokbase.com/t/gg/mongodb-user/122nd2nd3k/query-not-recording-too-large which implied that the $comment functionality should be available in all the officially-supported drivers. Right now its absence means that I can't easily track down which queries are causing the problem. (I'm getting a MongoWaitQueueException being thrown when I thought I was using the Mongo connection in a single-threaded way, and I've been trying to track it down for two weeks now with no success so far). So I, for one, would really appreciate having $comment available so that I could tag each query with the source file and line number (in our C# source) that it came from. That would have been an immense help in my current bug hunt. UPDATE: It turns out that the cause of my problem was a bug in Mono 3.12. I left a comment on |
| Comment by Aristarkh Zagorodnikov [ 25/Jan/16 ] |
|
Thank you, Craig, looking forward to any outcome of this. |
| Comment by Craig Wilson [ 25/Jan/16 ] |
|
Hi Aristarkh, I'm looking into this. The documentation certainly implies what you are hearing. I haven't been made aware of this feature. I'm going to re-open this ticket as it seems to be a legitimate request. Craig |
| Comment by Aristarkh Zagorodnikov [ 21/Jan/16 ] |
|
After reading the docs (https://docs.mongodb.org/v3.2/reference/operator/query/comment/#behavior) I was under impression that $comment is supported everywhere when matching is involved, incliding update query filters and $match aggregation pipeline fragments. Is this a documentation issue? |
| Comment by Craig Wilson [ 21/Jan/16 ] |
|
Hi Aristarkh, Commenting has been available in the driver for a long time. In 2.0, we made it a named parameter, but it could always have been passed as a modifier. However, comments are not available for all commands. In fact, it is only available for the find command (and the old OP_QUERY) stuff. This translates to it only being available in FindOptions. If you are interested in this feature for other things, I'd suggest you file a server ticket. Craig |