Google News
logo
PouchDB - Interview Questions
What is the use of db.info() method in PouchDB?
The db.info() method is used to get the information about the database. This method also accepts a callback function.
db.info([callback])   ?

See the given example for retrieving data from the database using the info() method. Here the database name is my_database.

Example :
//Requiring the package  
var PouchDB = require('PouchDB');  
//Creating the database object  
var db = new PouchDB('my_database');  
//Database information  
db.info(function(err, info) {  
 if (err) {  
   return console.log(err);  
 } else {  
   console.log(info);  
 }  
});  ?
Advertisement