[SERVER-10079] Cannot use $query together with $comment Created: 02/Jul/13  Updated: 06/Dec/22  Resolved: 05/Jul/19

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Johnny Boy Assignee: Backlog - Query Team (Inactive)
Resolution: Won't Do Votes: 0
Labels: query-44-grooming
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-6767 Interpret $query as special so you ca... Closed
Assigned Teams:
Query
Operating System: ALL
Participants:

 Description   

I wanted to use the special $comment field with pymongo for adding generic information about what code triggered the query.

To do this you need to do collection.find(

{"$query": ..., "$comment": ...}

).
But this breaks queries trying to count, always giving 0 as result.

Same goes for the cli.

This makes the usability of $comment much more complicated since you need to keep track of when your code might count on the cursor.



 Comments   
Comment by David Storch [ 05/Jul/19 ]

This ticket is referring to some oddities around the old OP_QUERY wire format for find operations. The modern way to express such operations, which all currently supported drivers use, is a find command using the OP_MSG wire protocol format. The find command supports the comment parameter in combination with all other options. Closing this ticket as Won't Do.

Generated at Thu Feb 08 03:22:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.