public override IEnumerable <KeyValuePair <AttributeValue, long> > Enumerate(QueryCriteria value)
        {
            var andPredicate = new ANDPredicate();

            foreach (var arrayElement in arraySequence)
            {
                andPredicate.AddChildPredicate(new EqualsPredicate(Source,
                                                                   new SingleAttributeValue(new ArrayElement(arrayElement.Value, arrayElement.Key)), IsInverse));
            }
            return(andPredicate.Enumerate(value));
        }
示例#2
0
        public override IEnumerable <KeyValuePair <AttributeValue, long> > Enumerate(QueryCriteria value)
        {
            var andPredicate = new ANDPredicate();

            foreach (var attributeValue in _allValues)
            {
                andPredicate.AddChildPredicate(new RangePredicate(Source,
                                                                  new SingleAttributeValue(new ArrayElement(attributeValue, 0)), IsInverse,
                                                                  new SingleAttributeValue(new ArrayElement(attributeValue, int.MaxValue))
                                                                  , IsInverse, IsInverse));
            }
            return(andPredicate.Enumerate(value));
        }
示例#3
0
        public override IEnumerable <KeyValuePair <AttributeValue, long> > Enumerate(QueryCriteria value)
        {
            var andPredicate = new ANDPredicate();

            for (int i = 0; i < sequence.Length; i++)
            {
                var currentElement = new SingleAttributeValue(new ArrayElement(sequence[i], i));
                andPredicate.AddChildPredicate(new EqualsPredicate(Source, currentElement, IsInverse));
            }

            foreach (var kvp in andPredicate.Enumerate(value))
            {
                IJSONDocument document = value.Store.GetDocument(kvp.Value, null);
                //Array array = document.GetArray(source.Attributes[0].Name);
                Array array = JsonDocumentUtil.GetArray(document, source.Attributes.Name);
                if (array.Length == sequence.Length)
                {
                    yield return(kvp);
                }
            }
        }