I'm using Jaydata JSLQ and Jaydata provider for IndexedDB, what I want to do is to get "top n" records. What I've done is first get the records in descending order then take the n max records from it, It looks like there is a bug or something with the provider, because what I get with descending order is right but the take function doesn't return top records from ordered list, it gets top records from ascending records!!. I've also tried "first" function and it didn't work either!. Below is how my code looks like:
offlinedb.TodoItems.orderByDescending('it.Id').take(2).toArray(function(items){
alert(item.Name);
});
I'd be so thankful if anyone could help me on this.