[SERVER-17928] choosing query field in system.profile Created: 08/Apr/15  Updated: 08/Apr/15  Resolved: 08/Apr/15

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

Type: Bug Priority: Minor - P4
Reporter: Parinaz Ameri Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
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
Operating System: ALL
Steps To Reproduce:

db.coll.setProfilingLevel(2)
db.system.profile.find({query: {$exists:1}})
db.system.profile.find({query: {$exists:1}}).count()

Participants:

 Description   

in a database where profiling is activated, if I query the existence of query attribute in system.profile it will get the following error:
error:

{ "$err" : "Can't canonicalize query: BadValue unknown top level operator: $exists", "code" : 17287 }

but if I add .count() to the end of this query, I will receive the number of such documents.



 Comments   
Comment by Scott Hernandez (Inactive) [ 08/Apr/15 ]

Unfortunately one needs to duplicate "$query/query" in the find like this until the underlying issue is resolved:

find({$query:{query:{$exists:1}}}

This is just an issue with the shell, and should not be a problem in other languages, but if there are issues then please file an issue for that language specifically.

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