May 20, 2021 WeChat Mini Program Development Document
The object contains a geo-location constructor.
The owning fields are as follows:
Field | Description |
---|---|
Point | Location point |
Construct a geographic location. Can be used to query criteria, update field values, or add field values when records are added.
The method signature is as follows:
function Point(longitude: number, latitude: number): Point
Method accepts two required parameters, the first is longitude and the second is latitude, so it is important to pay attention to the order
The sample code
const db = wx.cloud.database()
db.collection('todos').add({
description: 'eat an apple',
location: db.Geo.Point(113, 23)
})