Coder Social home page Coder Social logo

bcomnes / level-auto-index Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 3.0 84 KB

Automatic secondary indexing for leveldb and subleveldown

Home Page: https://npmjs.com/level-auto-index

License: MIT License

JavaScript 100.00%
leveldb nodejs indexing levelup autoindex

level-auto-index's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

level-auto-index's Issues

promises support

Hi! I found this module recently and I think its great!
I was using level with promises (async/await) and then I try to use AutoIndex. But quickly noticed something went wrong with level-hookdown, I get this output after a db.put(...):

node_modules/level-hookdown/index.js:60
      cb(err)
TypeError: cb is not a function

So I try calling the level methods using callbacks and everything works.
Would you consider a PR for handling promises support? Maybe you could give some hints on the level-auto-index code base, where to start and that.

Thanks in advance!

One-to-many index support

Does level-auto-index support aggregating multiple keys/object under a single index lookup?

For example, a chat app:
A message belongs to a room
I want an index by which I can look up all the messages in the same room

I have not been able to figure out how to do that with level-auto-index

An in-range update of memdown is breaking the build 🚨

Version 1.2.5 of memdown just got published.

Branch Build failing 🚨
Dependency memdown
Current Version 1.2.4
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As memdown is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 8 commits.

  • 1abc47b 1.2.5
  • 90e51b1 Merge pull request #69 from Level/greenkeeper/initial
  • f0b4b76 split up zuul on multiple matrix entries for each browser + test on latest only
  • 2610905 :arrow_up: bump abstract-leveldown
  • b9eb981 Update README.md
  • 9131113 docs(readme): add Greenkeeper badge
  • fb4a9cb chore(travis): whitelist greenkeeper branches
  • fe61dcd chore(package): update dependencies

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

create{Key/Read}Stream use the wrong keys

According to the documentation createKeyStream and createValueStream should use the indices as keys and the indexed values as values. However in reality it uses the keys of the original db on which the index has been created.

const autoLevelIdx  = require("level-auto-index");
const level         = require("level-mem");
async function printStream(text, stream, print) {
    await new Promise((res) => {
        stream.on("data", e => text += " | " + print(e));
        stream.on("end", res);
    });
    console.log(text);
}
(async function() {
    const db     = level();
    const byTitle = autoLevelIdx(db, level(), val => val);
    await Promise.all([db.put("A", "X"), db.put("B", "Y"), db.put("C", "Z")]);
    await printStream("ReadStream", byTitle.createReadStream(),  ({key, value}) => `${key}: ${value}`);
    await printStream("KeyStream",  byTitle.createKeyStream(),   (key) => key);
})();

According to the documentation this code should output:

ReadStream | X: X | Y: Y | Z: Z
KeyStream | X | Y | Z

In reality it generates the following output:

ReadStream | A: X | B: Y | C: Z
KeyStream | A | B | C

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.