Problem matching values in array

The way you are writing find( t : [ a , b ] ) means look for an array t that is exactly [ a , b ]. What I understand is that you want all entries that have both a and b. Even [ b , a ] does not match.

Consider

> db.tipo.find( {} , { _id : 0 } )
{ "t" : [ "a", "b" ] }
{ "t" : [ "b", "a" ] }
{ "t" : [ "a", "b", "c" ] }
{ "t" : [ "a", "c" ] }
{ "t" : [ "b", "c" ] }
> db.tipo.find( { "t" : [ "a" , "b" ] } )
{ "_id" : ObjectId("5eb04706f36eaa9b112e3ca6"), "t" : [ "a", "b" ] }
> db.tipo.find( { "t" : "a" , t: "b" } )
{ "_id" : ObjectId("5eb04706f36eaa9b112e3ca6"), "t" : [ "a", "b" ] }
{ "_id" : ObjectId("5eb04706f36eaa9b112e3ca7"), "t" : [ "b", "a" ] }
{ "_id" : ObjectId("5eb04706f36eaa9b112e3ca8"), "t" : [ "a", "b", "c" ] }
{ "_id" : ObjectId("5eb047f6f36eaa9b112e3caa"), "t" : [ "b", "c" ] }

The last one is a little bit closer that what you want but have an extra that does not have a. One way to do it would be to do a setIntersection and match on the size. Another way could be with 2 match stage pipeline where you match a in the first one and match b on the second one. Probably an elemMatch of some sort could work but could not come up with a working one in a timely manner.