1.

How To Delete A Remote Database That Is Stored On A Remotely Server Couchdb?

Answer»

PROVIDE the path of the remotely database CouchDB in PouchDB constructor to delete a database that is stored on a remotely server CouchDB.

For example:

//Requiring the PACKAGE 

var CouchDB = REQUIRE('Couchdb'); 

//Creating the database object 

var db = new PouchDB('http://localhost:5984/my_database'); 

//deleting database 

db.destroy(FUNCTION (err, response) { 

 if (err) { 

return console.log(err); 

 } ELSE

console.log("Database Deleted"); 

 } 

}); 

Provide the path of the remotely database CouchDB in PouchDB constructor to delete a database that is stored on a remotely server CouchDB.

For example:

//Requiring the package 

var CouchDB = require('Couchdb'); 

//Creating the database object 

var db = new PouchDB('http://localhost:5984/my_database'); 

//deleting database 

db.destroy(function (err, response) { 

 if (err) { 

return console.log(err); 

 } else { 

console.log("Database Deleted"); 

 } 

}); 



Discussion

No Comment Found