因为我match里有好多field需要匹配,希望使用类似_.expr($.and[])这样的方式组合多个field匹配条件。
但是我发现当尝试match({field: null})可以匹配到结果的时候,换成了match(_.expr($.eq(['$field', null])))后匹配到结果为0。
因为我match里有好多field需要匹配,希望使用类似_.expr($.and[])这样的方式组合多个field匹配条件。
但是我发现当尝试match({field: null})可以匹配到结果的时候,换成了match(_.expr($.eq(['$field', null])))后匹配到结果为0。
1 个回答
谢邀
where(_.expr($.eq(['$field', null])))
const res = await db.collection('orders')
.where(_.expr($.eq(['$customerId', null])))
.get()
const res = await db.collection('orders')
.where({
customerId: null
}).get()
好吧,先不说match还是where,如上我用where做了测试也是有同样问题的。