checkpoint: pre-refactor state before fixing P0/P1 issues

This commit is contained in:
2026-06-11 18:40:59 +08:00
parent 2c3c2653fa
commit d55ed60907
41 changed files with 1129 additions and 1051 deletions

View File

@@ -27,6 +27,11 @@ exports.main = async (event, context) => {
updatedAt: db.serverDate(),
}
// geo.near 距离查询字段;无定位时整个字段省略(写 null 会让地理索引构建失败)
if (location && typeof location.latitude === 'number' && typeof location.longitude === 'number') {
post.geo = db.Geo.Point(location.longitude, location.latitude)
}
const res = await db.collection('posts').add({ data: post })
// 更新用户帖子统计