How to use PouchDb with electron to store data? Do i need levelDb?


#1

I have install using the command line " npm install pouchdb ". After that i tried to create a database and save some information but it is not saving. I dont know what’s the problem? Can anyone help me please??
Here is the code:

const PouchDB=require(‘pouchdb’);
var db = new PouchDB(‘todos’);

            var todo = {
                _id: 2,
                title: 'My Pouch',
                completed: false
            };

            db.put(todo, function callback(err, result) {
                if (!err) {

                    alert("successfully saved");

                }

            });