public void test_child_collection_match_using_any() { var mongoRepository = new MongoRepository<User>(collection: "UserCollection"); mongoRepository.RemoveAll(); mongoRepository.Linq().ToList().Should().BeEmpty(); var user = new User() { Name = "1", Accounts = new List<Account>() { new Account() { Name = "a1", Prop2 = "p1" } } }; var user2 = new User() { Name = "2", Accounts = new List<Account>() { new Account() { Name = "a2", Prop2 = "p2" } } }; mongoRepository.Add(user); mongoRepository.Add(user2); mongoRepository.Linq().ToList().Should().HaveCount(2); var match = mongoRepository.Linq().SingleOrDefault(x => x.Accounts.Any(a => a.Name == "a1" && a.Prop2 == "p1")); match.Should().NotBeNull(); }