Skip to content

Loading…

Add Geo support in SearchBuilder.cfc #8

Open
marcesher opened this Issue · 0 comments

1 participant

@marcesher
Owner

Mongo Supports lightweight geospatial searching, described here: http://www.mongodb.org/display/DOCS/Geospatial+Indexing

I've added an ensureGeoIndex function into Mongo.cfc for creating the indexes, and you can currently use cfmongodb. to perform geo queries like so:

nearResult = mongo.query( collection ).add( "LOC", {"$near" = [38,-85]} ).search(limit=10);

But this is not idiomatic CFMongoDB and I'd like to add functions in SearchBuilder for building up the handful of geo queries.

I'm thinking something like:

mongo.query(coll).$near(field, min, max);

mongo.query(coll).$near(field, min, max, maxDistance);

we'd want support for $within, both "box" and "center", which would probably translate into

withinBox(..) and withinCenter(...)

Anything else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.