就在刚刚,云开发语法是不是改了什么东西?

发布于 7 年前作者 tangming3965 次浏览最后编辑 7 年前来自 ask

const countResult = await db.collection(dataBaseType)

.where({ status: status, shopId: myShopId, _openid: myOpenId })

.count()

在原来的云函数中,如果 shopId == null , 等价于下面的。相当于没有shopId这个查询条件,查询对象有没有shopId都可以。

const countResult = await db.collection(dataBaseType)

.where({ status: status,   _openid: myOpenId })

.count()

可以就在刚刚,你们变更了规则,如果shopId == null,查询的对象的shopId也必须为null。

这个语法变更,导致很多之前已经上线的小程序查询不到正确的数据。

1 回复
maoxiuying
maoxiuying1 楼5 年前

这里没有变更哦,是不是undefined和null都在使用呢