bcomnes / level-auto-index Goto Github PK
View Code? Open in Web Editor NEWAutomatic secondary indexing for leveldb and subleveldown
Home Page: https://npmjs.com/level-auto-index
License: MIT License
Automatic secondary indexing for leveldb and subleveldown
Home Page: https://npmjs.com/level-auto-index
License: MIT License
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!
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
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 πͺ
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
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.