This project has moved and is read-only. For the latest updates, please go here.

Geospatial indexing?

Jul 16, 2012 at 4:50 PM

Hi guys,

I am migrating from the (dead) NoRM Framework and trying your MongoRepository, I wonder if somehow I can make it work with GeoSpatial indexing? In NoRM I had to heavily hack it to make it work.


Jul 17, 2012 at 2:29 AM

I noticed there are some Geo method on the obsolete Collection class, like GeoNear among others. I was actually looking for some method that would run Within commands.

Jul 17, 2012 at 6:31 PM
Edited Jul 17, 2012 at 6:35 PM

MongoRepository is a (generic) Repository abstraction; specific details like geospatial indexing do not belong in such an abstraction. I'm afraid you'd be better off just using the 10gen driver directly or wrapping the geospatial functionality internally in a derived repository using the (indeed obsoleted) Collection property. For the latter option you might want to fork a project to simply remove the obsolete attribute; for MongoRepository I am, for now, a little hesitant to actually remove the .Collection property but I'm pretty sure it will be removed eventually (hence the obsolete attribute).

I don't see how, and don't know if, but there might be, eventually, some LINQ support for geospatial indexing. In that case the functionality will automatically be exposed via MongoRepository's (e.g. 10gen's) LINQ interface.