数据集合
{ _id: '', _openid: '其它用户openid', friends: ['当前用户openid'] }
安全规则为:
{
"read": "doc._openid == auth.openid || auth.openid in doc.friends",
"write": "doc._openid == auth.openid || auth.openid in doc.friends"
}
where语句:
写法一:{ _openid:'{openid}', friends:_.elemMatch(_.eq('当前用户openid')) }
写法二:_.or([ { _openid: '{openid}' }, { friends: _.elemMatch(_.eq('当前用户openid')) } ])
问题:当集合设置自定义上述安全规则后,where语句怎么调整都读不出数据,请大神指点,多选啦!