I'm looking for documents that have both 'e-campaigns' and 'p-campaigns' arrays that are non-empty:
db.coll.find( { 'p-campaigns':{$ne:[]} , 'e-campaigns' : {$ne:[]} } )
I run the query on each array separately and do find docs with non-empty p-campaigns and e-campaigns, but the combined conditions turns out empty. I know there are documents with both p-campaigns and e-campaigns non-empty. I've tried using $and, with the same result: no docs with both arrays non-empty.
Am I going about this the right way? If not, why? This seems like the logical way to run this query on the conditions above. Thanks.
'e-campaigns.0':{$exists:true}