silvrgit/db/maker.js

28 lines
692 B
JavaScript
Raw Normal View History

2016-03-24 17:09:42 +00:00
var nano = require('nano')('http://localhost:5984');
// clean up the database we created previously
nano.db.destroy('silvrgit', function () {
// create a new database
nano.db.create('silvrgit', function () {
// specify the database we are going to use
var keeper = nano.use('silvrgit');
// and insert a document in it
/* keeper.insert({ crazy: true }, 'rabbit', function(err, body, header) {
if (err) {
console.log('[alice.insert] ', err.message);
return;
}
console.log('you have inserted the rabbit.')
console.log(body);
});*/
});
});
/**
* Created by Martin on 02/03/2016.
*/