wx.getLocation({
type:"gcj02",
success: (res)=> {
console.log(res)
const db = wx.cloud.database();
const _ = db.command
db.collection("gasStation").where({
location: _.geoNear({
geometry:db.Geo.Point(res.longitude,res.latitude),
minDistance:0,
maxDistance:2000,
})
})
.then(console.log)
.catch(console.error)
},
})
总是报错:_.geoNear is not a function;at pages/test/test onReady function;at api getLocation success callback function
这是什么原因造成的?? 按照小程序数据库API文档写的;
db.command,geoNear