|
I created a 2d index with min=1 and max=10. Points on all four corners of the resulting square appear to be given different geo hash values:
MongoDB Enterprise > db.c.find()
|
{ "_id" : ObjectId("5d570b8ebb1f0afa30766039"), "loc" : [ 10, 10 ] }
|
{ "_id" : ObjectId("5d570c01bb1f0afa3076603b"), "loc" : [ 1, 1 ] }
|
{ "_id" : ObjectId("5d570c3cbb1f0afa3076603c"), "loc" : [ 1, 10 ] }
|
{ "_id" : ObjectId("5d570c40bb1f0afa3076603d"), "loc" : [ 10, 1 ] }
|
MongoDB Enterprise > db.c.find().hint({loc: "2d"}).returnKey()
|
{ "loc" : BinData(128,"AAAAAAAAAAA=") }
|
{ "loc" : BinData(128,"VVVVVVVVUAA=") }
|
{ "loc" : BinData(128,"qqqqqqqqoAA=") }
|
{ "loc" : BinData(128,"////////8AA=") }
|
It appears, therefore, that this is not an issue anymore. I dug around a bit in the key generation code for "2d" indexes, and found that we have special code to handle the case of points with a coordinate exactly equal to max:
https://github.com/mongodb/mongo/blob/166a5d78c1103a58dbd41d1e45aa6037ba4a3e42/src/mongo/db/geo/hash.cpp#L884-L888
Without further information to suggest there is a problem here, I am closing this ticket as "Gone Away".
|