#937·LokiJS

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

Author: gladjoyhubCreated Jul 27, 2024Updated Jul 31, 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;