Database

db={"orders":[{"_id":1102,"orderID":10340,"productCode":1,"item":"apple"},{"_id":3332,"orderID":10341,"productCode":2,"item":"banana"},{"_id":3443,"orderID":10342,"productCode":3,"item":"orange"},{"_id":4332,"orderID":10343,"productCode":4,"item":"milk"}],"productInfo":[{"_id":1102,"orderID":10340,"productCode":2,"description":"granny smith apples"},{"_id":3443,"orderID":10342,"productCode":4,"description":"blood oranges from Florida"},{"_id":1103,"orderID":10340,"productCode":1,"description":"golden delicious apples"},{"_id":3444,"orderID":10342,"productCode":3,"description":"valencia oranges"}]}

Query

db.orders.aggregate([{"$lookup":{"from":"productInfo","let":{"orderID":"$orderID","productCode":"$productCode"},"as":"productInfo","pipeline":[{/** look for matches in productInfo*/"$match":{"$expr":{"$and":[{"$eq":["$orderID","$$orderID"]},{"$eq":["$productCode","$$productCode"]}]}}},{/** if matched, no need to return everything*/"$project":{"_id":1}}]}},{/** match when no productInfo found*/"$match":{"$expr":{"$eq":[{"$size":"$productInfo"},0]}}},{/** output requested fields*/"$project":{"_id":0,"orderID":1,"productCode":1}}])

Result