index-keys

1.0.1 • Public • Published

index-keys

Generate keys for a kv store for indexing

npm install index-keys

Usage

const IndexKeys = require('index-keys')

const keys = new IndexKeys([
  [{
    key: 'age',
    type: 'uint'
  }],
  [{
    key: 'name',
    type: 'string'
  }]
])

const [byAge, byName] = keys.indexes

// null cause no prev value
const [dels, puts] = keys.update(null, { name: 'maf', age: 37 })

// update the record ...
const [dels, puts] = keys.update({ name: 'maf', age: 37 }, { name: 'maf', age: 38 })

License

Apache-2.0

/index-keys/

    Package Sidebar

    Install

    npm i index-keys

    Weekly Downloads

    0

    Version

    1.0.1

    License

    Apache-2.0

    Unpacked Size

    15.6 kB

    Total Files

    6

    Last publish

    Collaborators

    • mafintosh
    • andrewosh