Hi,

yes, the returned documents must be sorted in ascending key
order. though, I just noticed MongoDocumentStore does not
add a sort() to the query and ascending order of the result is
just a coincidence. MongoDB uses the index of the _id field
and will likely return the documents in the correct order.

I'll create an issue for the missing sort().

Regards
 Marcel 

> -----Original Message-----
> From: Julian Reschke [mailto:[email protected]]
> Sent: Mittwoch, 11. Dezember 2013 17:03
> To: [email protected]
> Subject: DocumentStore.query limit parameter
> 
> >     /**
> >      * Get a list of documents where the key is greater than a start value 
> > and
> >      * less than an end value. The returned documents are immutable.
> >      *
> >      * @param <T> the document type
> >      * @param collection the collection
> >      * @param fromKey the start value (excluding)
> >      * @param toKey the end value (excluding)
> >      * @param indexedProperty the name of the indexed property
> (optional)
> >      * @param startValue the minimum value of the indexed property
> >      * @param limit the maximum number of entries to return
> >      * @return the list (possibly empty)
> >      */
> >     @Nonnull
> >     <T extends Document> List<T> query(Collection<T> collection,
> >                                        String fromKey,
> >                                        String toKey,
> >                                        String indexedProperty,
> >                                        long startValue,
> >                                        int limit);
> 
> Is some kind of ordering implied? (Otherwise, how does "limit" make sense?)
> 
> Best regards, Julian

Reply via email to