Mathomania
Mathomania

Reputation: 33

Too many geoNear expressions error in MongoDB

{$and:[{
'polylineLocs': {
     '$nearSphere': {
         '$geometry': {
             'type': 'Point',
             'coordinates':
                 [78.02478824054135,
                 30.29090638871556
                    ]
         },
         '$maxDistance': 250,
         '$minDistance': 0
     }
 }
},
 {'location': {
         '$nearSphere': {
             '$geometry': {
                 'type': 'Point',
                 'coordinates': [ 78.0009260423163,
                 30.266704531034748
                 ]
             },
             '$maxDistance': 150,
             '$minDistance': 0
         }
     }
  }]}

I am getting this "Too many geoNear expressions" error while executing this in mongoDB. Are there any alternatives to use $and on coordinates.

Upvotes: 1

Views: 89

Answers (0)

Related Questions