我有一个mongo查询,例如:
"$lookup": {
"from": "CollectionA",
let: { fieldId: "A"},
pipeline: [
{ $match:
{ $expr:
{ $and:
[
{ $eq: [ "$A", "$$A" ] },
{ $eq: [ "$animals", "Cat" ] }
]
}
}
}
],
"as": "sample_lookup"
}
},
在上面的查询中,我希望将动物作为列表,例如$ animals:$in["cat","dog","Rat"]
..不确定在查询级别上是如何完成的..请帮助我将此查询转换为接受动物作为列表,然后获取所有与任何动物相匹配的记录...