unicloud 云数据库中 怎么添加一个 地理位置坐标字段
我用 ai 写了一个不知道是不是正确的?
"location":{
"bsonType": "object",
"description": "活动位置(GeoJSON格式)",
"title": "活动位置",
"properties":{
"type":{
"bsonType": "string",
"description": "位置类型,必须为Point",
"enum": ["Point"]
},
"coordinates":{
"bsonType": "array",
"description": "位置坐标 [经度, 纬度]",
"minItems": 2,
"maxItems": 2,
"items": {
"bsonType": "number"
}
}
},
"required": ["type", "coordinates"]
},
1 个回复
DCloud_uniCloud_CRL
地理位置可以定义为object,看下文档:https://doc.dcloud.net.cn/uniCloud/schema.html#bsontype