统计定点范围内的对象数量报错(geonear count)
发布于 5 年前 作者 suyang 937 次浏览 来自 问答

统计定点范围内的对象数量报错

db.collection('house').where({
 
location: _.geoNear({
 
geometry: db.Geo.Point(event.location.longitude, event.location.latitude),
 
minDistance: event.minDis,
 
maxDistance: event.maxDis
 
})
 
}).count()

返回

Error: errCode: -502001 database request fail | errMsg: [FailedOperation.Query] (BadValue) $geoNear, $near, and $nearSphere are not allowed in this context; 

现象和这个问题一样

回到顶部