> For best performance and scalability, avoid using this; instead create
> another view whose keys include the thing you want to sort by. But it’s not
> always possible to do this; sometimes you really need to specify a key
> range one way and then sort a different way. That’s what '
> *sortDescriptors*' feature is for
Sometimes you really need to specify a key range one way and then sort a
different way *& paginate the query results. *How can I achieve this?
Applying sortDescriptor + limit to query doesn't gives me expected result.
My situation is paginating a list of 'Issues'
- Apply *optional* filter criteria (filter by "Email" or "Status")
- sort by ("title" or "email" or "creation date" or "modified date")
So, my emit line looks like this,
emit(@[project,archived,map,status],@[title,email,creationDate,modifiedDate
]); //first 3 keys are very important filters
Is it not possible to apply sort descriptor and limit ? (please make my
life easy :D)
*postFilter Question*
I observed that applying "limit + postFilter" gives gives *limit+1*
results. Shall I file a issue?
Following returns me 51 results (without limit, 354 results).
query.postFilter = [NSPredicate predicateWithFormat:@"key[3] == %@",
@"created"];
query.limit = 50;
[query run:nil]
Thanks
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/b3794b73-8751-403a-a804-cdcd2f2f8648%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.