该对象上含有地理位置构造器。
拥有字段如下:
字段 | 说明 |
---|---|
point | 地理位置点 |
构造一个地理位置点。可用于查询条件、更新字段值或新增记录时的字段值。
方法签名如下:
function point(longitude: number, latitude: number): point
方法接受两个必填参数,第一个是经度(longitude),第二个是纬度(latitude),务必注意顺序
示例代码
const db = wx.cloud.database()
db.collection('todos').add({
description: 'eat an apple',
location: db.geo.point(113, 23)
})