jeudi 2 avril 2015

NEDB is clearing content of file when app's relauched

I have written NodeWebKitApp in which I saving user's data (like name, uid and settings for later use). I can insert document fine and I can see the content (file size is about 2 KB).


But, if close app and re-open app after closing, saved is lost and I see 0 bytes file size.


On debugging, I found that this happens when this line is executed: db = new Datastore({ filename: myPath, autoload: true });


I tried to debug nedb/persistance.js but could not get any success. I also tried loading d/b manually by calling loadDatabase(function(err) {}) but not success.


Here is snippet of code:



var Datastore = require('nedb'),


.. .. ..

myPath = "/.myApp/user.db", db = new Datastore({ filename: myPath, autoload: true });


Aucun commentaire:

Enregistrer un commentaire