kriszyp / lmdb-js

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

msgpack / Invalid type for key #6

Closed 1N50MN14 closed 4 years ago

1N50MN14 commented 4 years ago

Hi @kriszyp,

The recent changes you've been making are so awesome I got rid of so much bloat!

In the meantime I'm facing a strange issue when using msgpackr as the default encoder, a simple db.put('dymmy-key', {foo:1}, 1, 0) errors with:

Error: In database data: Invalid type for key.
    at /home/am/dev/dfv/platform/db/node_modules/lmdb-store/index.js:673:46

This doesn't happen if I change default encoding to json which is so strange.

Here are my settings:

    {
      encoding: 'msgpack',
      useVersions: true,
      commitDelay: 1,
      compression: true,
      sharedStructuresKey: Symbol.for('structures')
    },

I'm explicitly defining some of the defaults just in case, I also tried adding create as I saw in the tests, not sure what it does but that didn't help either.

I'm on the latest npm version. Not sure what I'm missing on...

Many thanks

1N50MN14 commented 4 years ago

Strike that... not sure what it was, I started with a fresh db, made sure all stores have unique structure keys and it worked. Likely my fault..