How to group documents by field1 and then query to see field2 is missing a value?

Sample documents for all you use-cases including:

Read Formatting code and log snippets in posts before supplying all documents we need to experiment.

Share exactly the code you

My approach would be to group on transaction_id using $addToSet for the status. Then a $match a $nin on the $addToSet array.

1 Like