Type() public static method

Tests that the type of the named element is equal to some type (see $type).
public static Type ( string name, BsonType type ) : QueryConditionList
name string The name of the element to test.
type BsonType The type to compare to.
return QueryConditionList
        public void TestType()
        {
            var query    = Query.Type("a", BsonType.String);
            var expected = "{ \"a\" : { \"$type\" : 2 } }";

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