[SERVER-675] count() broken with $min and $max Created: 25/Feb/10 Updated: 08/Jun/18 Resolved: 08/Jun/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying, Shell |
| Affects Version/s: | 2.4.7, 2.5.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Dwight Merriman | Assignee: | Asya Kamsky |
| Resolution: | Won't Fix | Votes: | 1 |
| Labels: | query_triage | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
Prepending description from SERVER 9548
So far so good.
I would like this count to return 4. Instead it returns 10. ---------- wrong result if this is hard to fix and mainly for mongos, we could uassert "not implemented", but we can't return wrong answer. |
| Comments |
| Comment by Asya Kamsky [ 08/Jun/18 ] | |
|
Since we are going to remove the count shell helper in the future, we won't work on this. | |
| Comment by Dwight Merriman [ 31/Mar/17 ] | |
|
The shell converts the find() into a { count : ... }command when the count() helper runs. Given that the count command has optional limit: and skip: parameters, i think the shell should forward them through, and it is not, at least not in the v3.2.x shell i just ran. It should be easy to modify _convertToCountCmd() to do this (which is called by count()). // limit: and skip: not passed through. ).limit(4).skip(2)._convertToCountCmd() , "fields" : { } } | |
| Comment by Asya Kamsky [ 31/Mar/17 ] | |
|
Is it really clear that it should return 4 and not 10? This returns 10:
| |
| Comment by auto [ 25/Feb/10 ] | |
|
Author: {'login': '', 'name': 'dwight', 'email': 'dwight@dmmb.local'}Message: minmaxtest |