How to apply $ne using $searchMeta?

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!

            "$searchMeta": {
                "index": "MsgAtlasIndex",
                "compound": {
                    "must": [
                        {"equals": {"path": "", "value": 1}},
                        {"range": {"path": "ts", "gte": new Date( - 24*60*60 * 1000)}},
                        {"text": {"query": "violent", "path": "evnt.tag"}},
                        {"equals": {"path": "evnt.cls", "value": True}},

Hi @ahmad_al_sharbaji ,

It is recommended to remove the field when the value is an empty array. Then you can implement this filter logic with the exists operator.