Ejemplo n.º 1
0
        /// <summary>
        /// Filters documents that only have the provided ids.
        /// Note, this filter does not require the _id field to be indexed since it works using the _uid field.
        /// </summary>
        public BaseFilter Ids(IEnumerable <string> types, IEnumerable <string> values)
        {
            if (!types.HasAny() || types.All(t => t.IsNullOrEmpty()))
            {
                return(CreateConditionlessFilterDescriptor("ids", null));
            }

            var filter = new IdsFilter {
                Values = values, Type = types
            };

            this.SetCacheAndName(filter);
            return(this.New(filter, f => f.IdsFilter = filter));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Filters documents that only have the provided ids.
        /// Note, this filter does not require the _id field to be indexed since it works using the _uid field.
        /// </summary>
        public BaseFilter Ids(string type, IEnumerable <string> values)
        {
            if (type.IsNullOrEmpty())
            {
                return(CreateConditionlessFilterDescriptor("ids", null));
            }

            var filter = new IdsFilter {
                Values = values, Type = new[] { type }
            };

            this.SetCacheAndName(filter);
            return(this.New(filter, f => f.IdsFilter = filter));
        }