https://github.com/fb55/level-insert
insert documents into a db with autoincrementing keys
https://github.com/fb55/level-insert
Last synced: 1 day ago
JSON representation
insert documents into a db with autoincrementing keys
- Host: GitHub
- URL: https://github.com/fb55/level-insert
- Owner: fb55
- Created: 2013-06-19T17:57:45.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2013-06-19T17:58:03.000Z (about 13 years ago)
- Last Synced: 2025-06-29T14:15:48.743Z (about 1 year ago)
- Language: JavaScript
- Size: 102 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#level-insert
a tiny module for inserting documents into a db with automatically increasing keys
###API
Initialisation:
```js
var db = require("level")("./.db");
require("level-sublevel")(db);
var sub = db.level("sub");
require("level-insert")(db, sub);
```
Only a single method is added: `insert(data, cb)`, which inserts the data at the next key (starting at 1).
Additionally, the key for the counter at the original DB can be specified as the third parameter of initialization. Per default, the separator + prefix of the insertion database will be used.
License: BSD