PouchDB Create Database




PouchDB Create Database

  • To create a database in PouchDB by using PouchDB constructor in Node.js command prompt.
 PouchDB Create Database

PouchDB Create Database

Syntax:

new PouchDB(Database_name)  

Create Database Example

  • To create a database, first you need to require the PouchDB package using the require() method.
//Requiring the package
var PouchDB = require('PouchDB');
//Creating the database object
var db = new PouchDB('First_Database');
console.log ("Database created Successfully.");

Read Also

  • Save the above code in a file named "Create_Database.js" within a folder name "PouchDB_Examples". Open the command prompt and Execute the JavaScript file:
node Create_Database.js  
 PouchDB Create Database

PouchDB Create Database

  • You'll be able to see "Database created successfully" message on your console. Now You can see the locally created Database folder in your current directory.


Related Searches to PouchDB Create Database