[SERVER-23000] mongodb 3.2:2d index return all document by default in "Proximity to a Point on a Flat Surface" ,not 100 as descripted in manual Created: 08/Mar/16  Updated: 14/Mar/16  Resolved: 11/Mar/16

Status: Closed
Project: Core Server
Component/s: Geo
Affects Version/s: 3.0.3, 3.2.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: jiawenjie Assignee: Kelsey Schubert
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File dump.tar.gz    
Issue Links:
Related
is related to DOCS-7405 Proximity queries do not return 100 l... Closed
Operating System: ALL
Steps To Reproduce:

1. create mongodb 3.2 and 2.6 instance respectively
2. using the dump file to restore the data.
3. db.player.find({'match_lv':{'$near':[1,0]}}).count();
4. in 3.2, it returns 1000 and in 2.6, it return 100(sorry for lack of 2.6 dumpfile)

Participants:

 Description   

I use 2-d index to match in player collection as follows

db.player.find({'match_lv':{'$near':[1,0]}}).count();

However, in mongodb 3.2, it return all documents not 100 document by default.
Btw, in mongodb 2.6, it return 100 document indeed and in mongodb3.0, it return all documents

I guess there is something wrong in mongdb 3.0 and mongodb 3.2 in 2-d index, because it conflict with manual



 Comments   
Comment by Kelsey Schubert [ 14/Mar/16 ]

Hi jiawenjie,

Thank you for pointing me to the documentation you were referencing. I have opened DOCS-7405 to update this page according to our discussion. Please feel free to watch DOCS-7405 and vote for it.

Best regards,
Thomas

Comment by jiawenjie [ 12/Mar/16 ]

Hi,Thomas Schubert
Thanks for your reply and your suggestions.
In addtion, Actually I am referencing the latest document which states as follows: "Proximity queries return the 100 legacy coordinate pairs closest to the defined point and sort the results by distance". Here is the link: https://docs.mongodb.org/manual/tutorial/query-a-2d-index/. So I just guess I misunderstand the document or there is something wrong in the latest document as mentioned above?
kind regards

Jia

------------------ 原始邮件 ------------------
发件人: "Thomas Schubert (JIRA)";<jira@mongodb.org>;
发送时间: 2016年3月12日(星期六) 凌晨5:51
收件人: "文杰"<514120001@qq.com>;

主题: [MongoDB-JIRA] (SERVER-23000) mongodb 3.2:2d index return alldocument by default in "Proximity to a Point on a Flat Surface" ,not 100 asdescripted in manual

[ https://jira.mongodb.org/browse/SERVER-23000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Schubert closed SERVER-23000.
------------------------------------
Fix Version/s: (was: debugging with submitter)
Resolution: Works as Designed

Hi jiawenjie,

Thanks for reporting this behavior. I believe you are referencing the 2.6 documentation which states that the $near queries that use a 2d index will return a limit of 100 documents.

In MongoDB 3.0, this limit is no longer used and our latest documentation does not mention this restriction. Please use limit() If you would like to limit the number of results.

Kind regards,
Thomas

----------------------
This message was sent from MongoDB's issue tracking system. To respond to this ticket, please login to https://jira.mongodb.org using your JIRA or MMS credentials.

Comment by jiawenjie [ 12/Mar/16 ]

Hi,Thomas Schubert
Thanks for your reply and your suggestions.
In addtion, Actually I am referencing the latest document which states as follows: "Proximity queries return the 100 legacy coordinate pairs closest to the defined point and sort the results by distance". Here is the link: https://docs.mongodb.org/manual/tutorial/query-a-2d-index/. So I just guess I misunderstand the document or there is something wrong in the latest document as mentioned above?

Comment by Kelsey Schubert [ 11/Mar/16 ]

Hi jiawenjie,

Thanks for reporting this behavior. I believe you are referencing the 2.6 documentation which states that the $near queries that use a 2d index will return a limit of 100 documents.

In MongoDB 3.0, this limit is no longer used and our latest documentation does not mention this restriction. Please use limit() If you would like to limit the number of results.

Kind regards,
Thomas

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