大佬们,云开发geopoint类型数据怎么更新?
发布于 5 年前 作者 yeguiying 15070 次浏览 来自 问答

大神请指教,如代码,更改了一晚,看了很多文档,实在不知道怎么样才能更新geopoint类型的数据了。谢谢!

WHInfo.where({
      _id:'a87a37b0-6680-4a7c-b2a4-e0d2ac34cd34',
      WHLAL:db.Geo.Point(112.97811,22.96833)
    })
    .update({
      data:{
        WHLAL:db.Geo.Point(133,22)
      }
    })

2 回复

用where update 得写成云函数

不过这样也可以 哈

demo.where({ 
  _id:'geopoint所在目录的_id' 
})
.update({ 
  data:{ 
    mLocation:db.Geo.Point(133 , 33) 
   } 
})
回到顶部