我正在尝试在$ or内使用$ text搜索。
await Creators.aggregate([ {$match: { $or: [ { $creatorId: { $in: [407, 409] } }, { $text: { $search: "Michael"} } ] } } ])
查询将不起作用。但是没有$ or的$ text可以正常工作。
有人对此有想法吗?谢谢。
$text运算符表达式在聚合中不能在$ or或$ not表达式中使用。请参阅to doc