-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: 2.2.7, 2.4.9, 2.6.0-rc1
-
Component/s: Diagnostics, Querying, Usability
-
None
-
Query Execution
-
None
-
None
-
None
-
None
-
None
-
None
-
None
There are several schemas for how queries with/without sort are stored in system.profile. This makes it unnecessarily complex to run aggregation over system.profile collections that access the query patterns.
There should be a single common format for all queries.
simple find, no sort : query on top level
db.docs.find({a: 1})
"query" : {
"a" : 1
},
find with sort, query is nested in another query field, without $.
db.docs.find({a: 1}).sort({b:1})
"query" : {
"query" : {
"a" : 1
},
"orderby" : {
"b" : 1
}
},
$query / $orderby syntax, results in nested $query field with $.
db.docs.find({ $query: {a: 1}, $orderby: {b: 1} })
"query" : {
"$query" : {
"a" : 1
},
"$orderby" : {
"b" : 1
}
},
- related to
-
SERVER-6768 MongoDB Profiler creates illegal documents
-
- Closed
-