ElemMatch() public static method

Tests that at least one item of the named array element matches a query (see $elemMatch).
public static ElemMatch ( string name, IMongoQuery query ) : QueryConditionList
name string The name of the element to test.
query IMongoQuery The query to match elements with.
return QueryConditionList
        public void TestElementMatch()
        {
            var query = Query.ElemMatch("x",
                                        Query.And(
                                            Query.EQ("a", 1),
                                            Query.GT("b", 1)
                                            )
                                        );
            var expected = "{ \"x\" : { \"$elemMatch\" : { \"a\" : 1, \"b\" : { \"$gt\" : 1 } } } }";

            Assert.AreEqual(expected, query.ToJson());
        }