You should use Query.All() . Code like this:
var array = new List<int>() {3, 4}; var query = Query.All("SomeArray", new BsonArray(array)); collection.Find(query);
Result Query.All will have all documents that have a nested array SomeArray with values 3 and 4 .
If you want 3 or 4 use Query.In("SomeArray", new BsonArray(array))
Documentation links: $ all , $ in
source share