Hi folks,
I have recently converted an application from PostGIS/Rails to the MEAN stack. I've been very happy with almost everything however I have hit one issue which I cannot find any obvious answer/work around for.
My application is a search tool that has both Geospatial and Text descriptions and I would like to be able to combine both together in the same query.
This is apparently not possible (example error message below):
find( { "add.loc": {$near: {$geometry: {type: "Point", coordinates: [116.425, -31.09]}, $maxDistance: 500000}}, $text: {$search: "hello"} }, { _id:0, fname:1, lname:1, add:1, } ).count()
2014-05-07T01:19:37.956+0200 count failed: {
"errmsg" : "exception: text and geoNear not allowed in same query",
"code" : 2,
"ok" : 0
} at src/mongo/shell/query.js:191
My questions is this: Is there any kind of work around for this (that would be better then merging the results by hand from two queries... This would work but I'd rather find a more elegant solution).
What about the map reduce framework? Reporting framework? (I'm not yet familiar with these)
Any tips would be greatly appreciated! There must be a nice way to make this work in Mongo! :-)
Thanks very much!
Brian.