MongoDB.Driver.Builders.DeprecatedQuery.NE C# (CSharp) Method

NE() public static method

Tests that the value of the named element is not equal to some value (see $ne).
public static NE ( string name, BsonValue value ) : QueryConditionList
name string The name of the element to test.
value BsonValue The value to compare to.
return QueryConditionList
        public static QueryConditionList NE(string name, BsonValue value)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            return new QueryConditionList(name).NE(value);
        }

Usage Example

        public void TestNotEquals()
        {
            var query    = Query.NE("j", 3);
            var expected = "{ \"j\" : { \"$ne\" : 3 } }";

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