Skip to content

Commit

Permalink
Update the example with .gitignore.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Ashworth committed May 2, 2013
1 parent 6bfbadb commit f23efcf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tmp
50 changes: 25 additions & 25 deletions example.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var fdb = require('./'),
util = require('util');

fdb.open('/Users/tom/dev/tmp/test-fdb', function (err, db) {
fdb.open('tmp/test-fdb', function (err, db) {

db.use('bins')
.save({
Expand All @@ -10,34 +10,34 @@ fdb.open('/Users/tom/dev/tmp/test-fdb', function (err, db) {
html: '<html>Version 2 - edited again</html>'
}
})
.exec(function (err, bin) {
console.log.apply(console, [].slice.call(arguments));
.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, bin) {
// console.log('saved:', bin);
// });
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('abc')
// .exec(function (err, bin) {
// console.log('found:', bin);
// });
db.use('bins')
.findById('test')
.exec(function (err, data) {
console.log('findById:', util.inspect(data, { depth: null, colors: true }));
});

// .find() here is optional
// db.use('bins')
// .find()
// .exec(function (err, data) {
// console.log(util.inspect(data, { depth: null, colors: true }));
// });
db.use('bins')
.find()
.exec(function (err, data) {
console.log(util.inspect(data, { depth: null, colors: true }));
});

});

0 comments on commit f23efcf

Please sign in to comment.