0
这是我的聚集:
query = [
{'$match' : { 'location' : {
'$geoWithin': {'$center' : [ [lng,lat], distance ] }} }}
]
dumps(DB.venue.aggregate(query))
但是它抛出:
OperationFailure: command SON([('aggregate', u'venue'), ('pipeline',
[{'$match': {'location': {'$geoWithin': {'$center': [[u'23.729310', u'37.983716'],
0.0023544184586407157]}}}}])]) failed: exception: Malformed geo query: { $geoWithin:
{ $center: [ [ "23.729310", "37.983716" ], 0.002354418458640716 ] } }
我也试图与$within
代替$geoWithin
和$centerSphere
,而不是$center
但没有。 find()查询通常在内部和中心(docs)内工作。
这是一个错误,或只是不支持pymongo?由于java驱动程序与$geoWithin
和$centerSphere
正常工作。第一