kriszyp / lmdb-js

Simple, efficient, ultra-fast, scalable data store wrapper for LMDB
Other
520 stars 44 forks source link

filter breaks following forEach in 3.1.0-3.1.5 #313

Closed awick closed 1 day ago

awick commented 2 weeks ago

The following code works in 3.0.14 but not 3.1.0-3.1.5

const store = open({ path: '/tmp/cont3xt-db', compression: true });
const overviewStore = store.openDB('overviews');

overviewStore.getRange({})
  .forEach(({ key, value }) => { console.log("ALW1", key, value); });

overviewStore.getRange({})
  .filter(({ key, value }) => { return true; })
  .forEach(({ key, value }) => { console.log("ALW2", key, value); });

Looks like some kind options are expected to be set

            if (options.continueOnRecoverableError)
                        ^

TypeError: Cannot read properties of undefined (reading 'continueOnRecoverableError')
    at iterable.iterate (/Users/andywick/test/node_modules/lmdb/dist/index.cjs:1440:16)
    at RangeIterable.forEach (/Users/andywick/test/node_modules/lmdb/dist/index.cjs:1448:40)
    at Object.<anonymous> (/Users/andywick/test/foo.js:10:4)
awick commented 1 day ago

Confirmed 3.1.6 works for us, thanks!