1 | #!/usr/bin/env node
|
2 |
|
3 | var base = require('./base.js');
|
4 |
|
5 |
|
6 |
|
7 | base(function(err, db, tree, cb) {
|
8 | if(err) return cb(err);
|
9 |
|
10 | console.log("parent:", tree.parentPathFromPath('foo.bar.baz'));
|
11 |
|
12 | tree.parentFromPath('foo.bar.baz', function(err, key, value) {
|
13 | if(err) return cb(err);
|
14 |
|
15 | console.log("parent of baz: key:", key, "value:", value);
|
16 |
|
17 | tree.parentFromPath('foo', function(err, key, value) {
|
18 | if(err) return cb(err);
|
19 |
|
20 | console.log("parent of foo: key:", key, "value:", value);
|
21 |
|
22 | tree.parentPathFromValue({}, function(err, path) {
|
23 | if(err) return cb(err);
|
24 |
|
25 | console.log("parent path of foo:", path);
|
26 |
|
27 | cb();
|
28 | });
|
29 | });
|
30 | });
|
31 | });
|
32 |
|