Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incremental-indexeddb-adapter lokiid($loki) should start with 1 not 0 #937

Open
gladjoyhub opened this issue Jul 27, 2024 · 2 comments
Open

Comments

@gladjoyhub
Copy link

gladjoyhub commented Jul 27, 2024

src/incremental-indexeddb-adapter.js line 69 to 72

// chunkId - index of the data chunk - e.g. chunk 0 will be lokiIds 0-99
IncrementalIndexedDBAdapter.prototype._getChunk = function(collection, chunkId) {
// 0-99, 100-199, etc.
var minId = chunkId * this.chunkSize;

should be:

// chunkId - index of the data chunk - e.g. chunk 0 will be lokiIds 1-100
IncrementalIndexedDBAdapter.prototype._getChunk = function(collection, chunkId) {
// 1-100, 101-200, etc.
var minId = chunkId * this.chunkSize + 1;
@radex
Copy link
Contributor

radex commented Jul 29, 2024

why is that?

@gladjoyhub
Copy link
Author

integer primary key in various databases usually start with 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants