I’m counting documents based on specific filters.
What is the proper way to add this line "att": {"$ne": []}
to this aggregation pipeline?
Note that I’m using $searchMeta
way for better speed!
my_collection.aggregate(
[
{
"$searchMeta": {
"index": "MsgAtlasIndex",
"compound": {
"must": [
{"equals": {"path": "evnt.st", "value": 1}},
{"range": {"path": "ts", "gte": new Date(Date.now() - 24*60*60 * 1000)}},
{"text": {"query": "violent", "path": "evnt.tag"}},
{"equals": {"path": "evnt.cls", "value": True}},
]
},
},
},
]
)