/** * * User: Martin Donnelly * Date: 2016-06-28 * Time: 14:50 * */ var nano = require('nano')('http://localhost:5984'); var db_name = 'mqtt'; // Clean up the database we created previously nano.db.destroy(db_name, function() { // Create a new database nano.db.create(db_name, function() { // Specify the database we are going to use var newDB = nano.use(db_name); }); });