-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.js
42 lines (36 loc) · 960 Bytes
/
example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var fdb = require('./'),
util = require('util');
fdb.open('tmp/test-fdb', function (err, db) {
db.use('bins')
.save({
_id: 'VTIN9PHZv5',
'2': {
html: '<html>Version 2 - edited again</html>'
}
})
.exec(function (err, data) {
console.log('saved:', util.inspect(data, { depth: null, colors: true }));
});
db.use('bins')
.save({
html: '<h1>Hello</h1>',
js: 'console.log("No.");'
})
.save({
_id: 'test',
css: '.nose { color: red; }'
})
.exec(function (err, data) {
console.log('saved:', util.inspect(data, { depth: null, colors: true }));
});
db.use('bins')
.findById('test')
.exec(function (err, data) {
console.log('findById:', util.inspect(data, { depth: null, colors: true }));
});
db.use('bins')
.find()
.exec(function (err, data) {
console.log(util.inspect(data, { depth: null, colors: true }));
});
});