KD-tree in a MongoDB DB collection
I am trying to solve the k nearest neighbor problem on a 开发者_JAVA百科set of objects in 3-space. These objects live in a MongoDB collection with all the joy and sorrow that comes with document based storage. Given one object I would like to find the k nearest neighbors in the fewest queries as possible. the collection sized is expected to be about 10^5 and k is between 10 and 50. I would really prefer not to have to store the entire tree in memory.
How could one store a KD-Tree in a MongoDB collection?
精彩评论