代码如下,我希望:
条件一:isClosedLoop: event.isClosedLoop
条件二:frontlineOpenId或supportOpenId等于thisOpenId
按照如下写法,isClosedLoop这个条件并不生效,请指教怎么写才规范,谢谢
const query = await db.collection('support').where(_.or([{
frontlineOpenId: thisOpenId
},
{
supportOpenId: thisOpenId
}
]), {
isClosedLoop: event.isClosedLoop
}).orderBy('createTime', 'desc').get()
db.collection('support').where(_.and([ {isClosedLoop: event.isClosedLoop}, _.or([ {frontlineOpenId: thisOpenId}, {supportOpenId: thisOpenId} ]) ])).orderBy('createTime', 'desc').get()
若认为该回答有用,给回答者点个[ 有用 ],让答案帮助更多的人
db.collection('support').where(_.and({isClosedLoop: event.isClosedLoop},_.or({frontlineOpenId: thisOpenId},{supportOpenId: thisOpenId}))).orderBy('createTime', 'desc').get()
用and连接两个条件试试