Beispiel #1
0
        public IEnumerable <long> ReadIds(Query query)
        {
            if (SessionFactory.CollectionExists(query.Collection))
            {
                var result = MapReduce(query);

                if (result == null)
                {
                    this.Log("found nothing for query {0}", query);

                    return(new long[0]);
                }

                return(new Dictionary <long, float>(result.SortedDocuments).Keys);
            }

            return(new long[0]);
        }
Beispiel #2
0
        public IEnumerable <long> ReadIds(Query query)
        {
            if (SessionFactory.CollectionExists(query.Collection))
            {
                var result = Execute(query);

                if (result == null)
                {
                    this.Log("found nothing for query {0}", query);

                    return(Enumerable.Empty <long>());
                }

                return(result.Documents.Keys);
            }

            return(new long[0]);
        }
Beispiel #3
0
        public ReadResult Read(Query query)
        {
            if (SessionFactory.CollectionExists(query.Collection))
            {
                var result = MapReduce(query);

                if (result != null)
                {
                    var docs = ReadDocs(result.SortedDocuments);

                    return(new ReadResult {
                        Total = result.Total, Docs = docs
                    });
                }
            }

            this.Log("found nothing for query {0}", query);

            return(new ReadResult {
                Total = 0, Docs = new IDictionary <string, object> [0]
            });
        }