PouchDB Create Database
PouchDB constructor is used in Node.js command prompt to create a database in PouchDB.
Syntax:
new PouchDB(Database_name)
Example:
- Open Node.js command prompt.
- Create a file named “Example.js” within a folder named “Examples”.
- Add the below code to the file.
Example.js:
var PouchDB = require('PouchDB'); var x = new PouchDB('Example_Database'); console.log ("Database Successfully Created.");
Open the command prompt and Execute the .js file.
node Example.js
Console Output:
Database Successfully Created.
The newly created Database can then be verified in the current directory.