I have a mongo query which runs fine on my production server. But it does not return results on my dev server. My db on dev server is replica of db on live.
Prod - AWS:
mongo v3.0.7
Dev - Digital Ocean
mongo v3.0.9
Mongo Query (run using RoboMongo) - Coordinates masked for anonimity ;)
db.getCollection('$cmd').findOne({
"geoNear": "ProviderData",
"near": [
XX.1325611,
XX.1357446
],
"spherical": true,
"distanceMultiplier": 6378137,
"query": {
"BusinessType": "557ff3f98b424a1009776ba5",
"Status": "1"
}
})
The document which should return in the search looks like this (removed irrelevent fields):
{
"_id" : ObjectId("566xxxxxxxxxxxxxxxxxxdb0"),
"ProviderName" : "Test Fitness Business",
"BusinessType" : "557ff3f98b424a1009776ba5",
"Location" : {
"Longitude" : XX.135745,
"Latitude" : XX.132561
},
"ImageFlag" : "1",
"Status" : "1",
"OrderEmail" : "tests@test3.com",
"Radius" : "12",
"ParentCompanyName" : "Test Fitness Business",
}
My Live server returns the above doc and two others. On Dev server i just get
{
"ok" : 0,
"errmsg" : "no geo indices for geoNear"
}
What am I doing wrong?
EDIT: Other simple CRUD queries work just fine on both servers.