First off, is it even allowed to do this:
(pseudo code below)
var userQueryOne = new Parse.Query(Parse.User);
userQueryOne.someConstraint1
userQueryOne.someConstraint2
var userQueryTwo = new Parse.Query(Parse.User);
userQueryTwo.someConstraint1
userQueryTwo.someConstraint2
var combinedInstallationQuery = Parse.Query.or(userQueryOne, userQueryTwo);
combinedInstallationQuery.withinMiles("lastLocation", itemGeopoint, 10);
Assuming the above line is allowed, when I run this query, I get this on the Server App Logs:
[32minfo [39m: warning: error while sending push MongoError: error processing query: ns=ae6c919607ed4fefa0bfe1170e735acb._Installation limit=0 skip=0
Tree: $and
$or
_p_user $in [ ]
_p_user $in [ "_User$LUbRhX9iY1" ]
deviceType == "ios"
GEONEAR field=lastLocation maxdist=0.00252602 isNearSphere=1
Sort: {}
Proj: {}
planner returned error: unable to find index for $geoNear query
at Function.MongoError.create (/usr/src/app/node_modules/mongodb/node_modules/mongodb-core/lib/error.js:31:11)
at toError (/usr/src/app/node_modules/mongodb/lib/utils.js:114:22)
at /usr/src/app/node_modules/mongodb/lib/collection.js:1008:67
at commandCallback (/usr/src/app/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:1194:9)
at Callbacks.emit (/usr/src/app/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:119:3)
at null.messageHandler (/usr/src/app/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:358:23)
at Socket.<anonymous> (/usr/src/app/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:292:22)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:153:18)
This seems to be the most descriptive line:
planner returned error: unable to find index for $geoNear query
I have also printed out my itemGeopoint variable, and it is ok (I removed my location for privacy purposes):
{ longitude: ###,
latitude: ###,
__type: 'GeoPoint' }
Please advice.
Thanks in advance.