Hello,
Currently, in my application I have the need to perform a longest prefix matching, like the following :
In my DB I have the following :
Prefix : 123
Prefix : 2345
Prefix : 1234
Prefix : 6789
If my input is 123456789, the result should be 1234, since it's the longest common prefix.
Currently, I operate this by loading all the info in memory and relying on tries for fast access. While this has advantages, my dataset is quickly growing large enough that it cannot fit entirely in RAM, so I am looking into MongoDB, and trying to figure out a way to map this usage case to it.
Has anybody got any ideas about how I could do this with Mongo ?
Regards,
Vlad