云数据库使用_.all(["{openid}"])时,{openid}没有被替换为用户openid
发布于 5 年前 作者 guiyingpeng 1241 次浏览 来自 官方Issues

当查询条件为{openids: _.all(["{openid}"]) }时,(openids 为数组类型)

{openid}没有被替换


当查询条件为{openid_str: “{openid}” }时,(openid_str 为字符串类型)

{openid}正确替换

1 回复

我也发现这个问题了,下面这样不行,openid不会被替换掉

db.collection('bottle-group')
.aggregate()
.sort({view: -1})
.limit(20)
.project({
likeCount: db.command.aggregate.size("$users_like_this"),
ilikethis: db.command.aggregate.in(["{openid}", "$users_like_this"])
})
.end()
回到顶部