Database

[{"key":1},{"key":2}]

Query

db.collection.aggregate([{$match:{$expr:{$switch:{branches:[{case:{$eq:[{$ifNull:[1,0]},0]},then:{$eq:["$ordcat._id",1]}},{case:{$eq:[{"$ifNull":[1,0]},0]},then:{$eq:["$_id",1]}}],default:{$and:[{$eq:["$_id",1]},{$eq:["$ordcat_id",1]}]}}}}}])

Result