range example please #105
-
Hi, I'm trying to use range to 'scan' rows. I'm confused by start/end args. Is there a real example? tia for past support. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
There are quite a few examples of range arguments in the tests, like https://github.com/DoctorEvidence/lmdb-js/blob/master/test/index.test.js#L396, although not sure if there is something more real or specific you are looking for. The |
Beta Was this translation helpful? Give feedback.
-
I'm looking for hello world.
Is 1 and 100 good for start and end?
…On Mon, Dec 6, 2021 at 7:13 PM Kris Zyp ***@***.***> wrote:
There are quite a few examples of range arguments in the tests, like
https://github.com/DoctorEvidence/lmdb-js/blob/master/test/index.test.js#L396,
although not sure if there is something more real or specific you are
looking for. The start and end properties specify the key range, and then
within that range, the offset specifies the number of entries to skip
before returning/iterating entries, and the limit specifies the maximum
number of entries to return/iterate through. Are you looking for a specific
use case?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#105 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASK4M5DNJ7IERCEU6FBGAOLUPVNSZANCNFSM5JQANCGA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
@kriszyp THANK YOU. I could use db.getKeys to scan from start, and use limit and offset to get 1K rows at a time and continue. |
Beta Was this translation helpful? Give feedback.
-
Yes, that's correct, there wouldn't be anything meaningful about doing a range query on random GUIDs. But, like you said, you could still do range query of the whole database, and use offset/limit to get sections (and you could do that by just omitting the start and end properties, and then the range will be across the whole database):
|
Beta Was this translation helpful? Give feedback.
-
Got it thanks. |
Beta Was this translation helpful? Give feedback.
Yes, that's correct, there wouldn't be anything meaningful about doing a range query on random GUIDs. But, like you said, you could still do range query of the whole database, and use offset/limit to get sections (and you could do that by just omitting the start and end properties, and then the range will be across the whole database):