[SERVER-12320] geoNear result is very different from previous versions. Created: 10/Jan/14  Updated: 10/Dec/14  Resolved: 26/Aug/14

Status: Closed
Project: Core Server
Component/s: Geo
Affects Version/s: 2.5.4
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Craig Wilson Assignee: Unassigned
Resolution: Done Votes: 0
Labels: nqf, query_triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

Given the command:

{ "geoNear" : "testcollection", "near" : [0.0, 0.0], "num" : 100, "distanceMultiplier" : 1.0, "maxDistance" : 100.0 }

< 2.5.4 returns this result:

{ "ns" : "csharpdriverunittests.testcollection", "near" : "1100000000000000000000000000000000000000000000000000", "results" : [{ "dis" : 1.4142135623730952, "obj" : { "_id" : ObjectId("52d02162dd63bf086404c6c1"), "Location" : [1.0, 1.0], "Name" : "One", "Type" : "Museum" } }, { "dis" : 2.23606797749979, "obj" : { "_id" : ObjectId("52d02162dd63bf086404c6c2"), "Location" : [1.0, 2.0], "Name" : "Two", "Type" : "Coffee" } }, { "dis" : 3.1622776601683795, "obj" : { "_id" : ObjectId("52d02162dd63bf086404c6c3"), "Location" : [1.0, 3.0], "Name" : "Three", "Type" : "Library" } }, { "dis" : 4.1231056256176606, "obj" : { "_id" : ObjectId("52d02162dd63bf086404c6c4"), "Location" : [1.0, 4.0], "Name" : "Four", "Type" : "Museum" } }, { "dis" : 5.0990195135927845, "obj" : { "_id" : ObjectId("52d02162dd63bf086404c6c5"), "Location" : [1.0, 5.0], "Name" : "Five", "Type" : "Coffee" } }], "stats" : { "time" : 0, "btreelocs" : 0, "nscanned" : 5, "objectsLoaded" : 5, "avgDistance" : 3.2069368678503425, "maxDistance" : 5.09903122655428 }, "ok" : 1.0 }

2.5.4 now returns the following result.

{ "results" : [{ "dis" : 1.4142135623730952, "obj" : { "_id" : ObjectId("52d020e9dd63bf0ae4d350e4"), "Location" : [1.0, 1.0], "Name" : "One", "Type" : "Museum" } }, { "dis" : 2.23606797749979, "obj" : { "_id" : ObjectId("52d020e9dd63bf0ae4d350e5"), "Location" : [1.0, 2.0], "Name" : "Two", "Type" : "Coffee" } }, { "dis" : 3.1622776601683795, "obj" : { "_id" : ObjectId("52d020e9dd63bf0ae4d350e6"), "Location" : [1.0, 3.0], "Name" : "Three", "Type" : "Library" } }, { "dis" : 4.1231056256176606, "obj" : { "_id" : ObjectId("52d020e9dd63bf0ae4d350e7"), "Location" : [1.0, 4.0], "Name" : "Four", "Type" : "Museum" } }, { "dis" : 5.0990195135927845, "obj" : { "_id" : ObjectId("52d020e9dd63bf0ae4d350e8"), "Location" : [1.0, 5.0], "Name" : "Five", "Type" : "Coffee" } }], "stats" : { "nscanned" : NumberLong(0), "objectsLoaded" : NumberLong(5), "avgDistance" : 3.2069368678503425, "maxDistance" : 5.0990195135927845, "time" : 1 }, "ok" : 1.0 }

These are somewhat significantly different, including missing "ns" and "near" top-level fields and the "stats" document containing different values as well, notable missing "btreelocs" and "nscanned".



 Comments   
Comment by Greg Studer [ 26/Aug/14 ]

v2.6 changed the explain format somewhat for geospatial queries, issues in v2.6 explain have their own ticket tracking or are WAD.

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