3

How does MongoDB handle range and nearest neighbor queries? what algorithms used?

I know MongoDB use GeoHash and B-Tree to index spatial data but how it handle the range and nearest neighbor queries are never mentioned in any doc.

Also, MongoDB can only handle 100 NN by using $near. That may implies that the NN algorithm is not efficient?

dykw
  • 1,199
  • 3
  • 13
  • 17
  • 1
    The source code is available [here](https://github.com/mongodb/mongo). I'd suggest you look there if you want to look for inefficiencies. – WiredPrairie Apr 02 '13 at 19:44
  • 3
    @WiredPrairie, the question was "how does mongo handle NN". Pointing to a humongous repo of code is both unhelpful and patronizing. – thorwhalen Apr 16 '15 at 08:43

0 Answers0