Anyone knows how the geospatial indexing works, i mean the algorithm to calculate nearest points?
In SQL we may do things like this:
SELECT id, (x-a)*(x-a)+(y-b)*(y-b) as distance FROM table1 ORDER by distance ASC
Sure this is not efficient enough compared with mongodb's geospatial indexing, but how does mongodb calculate and sort?
Many thanks in advance.