[SERVER-8888] runCommand with distinct and the db.xxx.distinct return different results when using $near in the query Created: 07/Mar/13 Updated: 21/Jul/15 Resolved: 07/Jan/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo, Querying |
| Affects Version/s: | 2.2.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kiko Fernandez | Assignee: | Siyuan Zhou |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | distinct, near, runCommand | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Amazon Linux AMI x86_64 EBS, Micro Instance (613 MiB memory) |
||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | ALL | ||||
| Steps To Reproduce: | You have to run two queries, one using the db.runCommand with a distinct query that uses the $near operator, and the equivalent query written using the syntax _db.xxx.distinct. For example:
|
||||
| Participants: | |||||
| Description |
|
The results given by runCommand with in a distinct query using the $near operator are different from the equivalent *db.advice.distinct* query. When we run the following command, we get 100 results:
, and running the equivalent query using distinct returns only 75:
We don't understand why we get different results because the second query is a wrapper around the first one. In any case, we wanted to use the first query (runCommand) in the Java driver because it gives us the results that we need. Thus, we wrote the runCommand query in Java but the result that we got is the same as if we were using the db.advice.distinct query. |
| Comments |
| Comment by Siyuan Zhou [ 07/Jan/15 ] | ||||||||||||||||||||||||||||||||||||||
|
Hi kikofernandez, we haven’t heard back from you for some time, so I’m going to mark this ticket as resolved. If this is still an issue for you, feel free to re-open the ticket and provide additional information. Regards, Siyuan | ||||||||||||||||||||||||||||||||||||||
| Comment by Siyuan Zhou [ 08/Dec/14 ] | ||||||||||||||||||||||||||||||||||||||
|
Hi kikofernandez, we still need the reproduction to diagnose the problem. If this is still an issue for you, can you please send us the sample data so we can reproduce it? Thanks, Siyuan | ||||||||||||||||||||||||||||||||||||||
| Comment by Siyuan Zhou [ 30/Oct/14 ] | ||||||||||||||||||||||||||||||||||||||
|
Hi kikofernandez, Thank you for your report. I tried to generate the data and reproduce this issue with the following code.
But I am not able to reproduce this problem with 2.2.7 and 2.7.8. If you still encounter this problem, please attach the sample data to this ticket so that we can reproduce it. Thanks, |