1 |
|
2 |
|
3 | var base = require('./base.js');
|
4 |
|
5 | /*
|
6 | Example showing basic matching.
|
7 |
|
8 | Note that opts.match can also be a function
|
9 | or a buffer if the database uses buffer paths.
|
10 | */
|
11 |
|
12 | base(function(err, db, tree, cb) {
|
13 | if(err) return cb(err);
|
14 |
|
15 | tree.children(null, {
|
16 | match: 'ba',
|
17 | matchAncestors: true // switch to false to not include ancestors of match
|
18 | }, function(err, children) {
|
19 | if(err) return cb(err);
|
20 |
|
21 | console.log("matches:", children);
|
22 |
|
23 | cb();
|
24 | });
|
25 | })
|
26 |
|