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

All() public static method

Tests that the named array element contains all of the values (see $all).
public static All ( string name ) : QueryConditionList
name string The name of the element to test.
return QueryConditionList
        public static QueryConditionList All(string name, params BsonValue[] values)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (values == null)
            {
                throw new ArgumentNullException("values");
            }
            return new QueryConditionList(name).All(values);
        }

Same methods

DeprecatedQuery::All ( string name, BsonArray values ) : QueryConditionList
DeprecatedQuery::All ( string name, IEnumerable values ) : QueryConditionList

Usage Example

        public void TestAllParams()
        {
            var query    = Query.All("j", 2, 4, null, 6); // null will be skipped due to functional construction semantics
            var expected = "{ \"j\" : { \"$all\" : [2, 4, 6] } }";

            Assert.AreEqual(expected, query.ToJson());
        }
All Usage Examples Of MongoDB.Driver.Builders.DeprecatedQuery::All