I’m using a cursor with a lower bound range query. I can’t find a way to limit the number of objects returned, similar to a “LIMIT n” clause in a databse.
var keyRange = IDBKeyRange.lowerBound('');
Does it not exist ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As you’re iterating through the results, you can stop at any time. Something like this should work:
Also, in the special case where you are selecting based on a key that is made up of sequential numbers, you could use a keyRange to explicitly return only a certain range. But that’s generally not the case.