LokiJS icon indicating copy to clipboard operation
LokiJS copied to clipboard

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

Open gladjoyhub opened this issue 6 months ago • 2 comments

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;

gladjoyhub avatar Jul 27 '24 20:07 gladjoyhub