1 |
|
2 |
|
3 | var base = require('./base.js');
|
4 |
|
5 | // base() creates a leveldb and a level-tree-index with some test data
|
6 | // the callback deletes the database
|
7 | base(function(err, db, tree, cb) {
|
8 | if(err) return cb(err);
|
9 |
|
10 | var s = tree.pathStream({
|
11 | gte: 'foo',
|
12 | lte: tree.lteKey('foo.ba')
|
13 | });
|
14 |
|
15 | s.on('data', function(path) {
|
16 | console.log(path);
|
17 | });
|
18 |
|
19 | s.on('end', function() {
|
20 | cb();
|
21 | });
|
22 |
|
23 | s.on('error', function(err) {
|
24 | cb(err);
|
25 | });
|
26 | });
|
27 |
|