diskDB icon indicating copy to clipboard operation
diskDB copied to clipboard

Save Error

Open skmani opened this issue 8 years ago • 2 comments

hi i am new to this development. i am using diskdb for saving data. it works fine but when i close the app and reopen, all data disappears seems not saved in JSON file. anyone please help me.

skmani avatar Jan 29 '17 18:01 skmani

@skmani Are you able to replicate through a small snippet of code? Does the db file get removed when the app/server is stopped? Or does it persist? Is the path always the same?

patchfx avatar Feb 06 '17 08:02 patchfx

Thanks for Your response.

DB file exist with default data and the path always tha same.

Here is the code: dash.addUser = function(id,name,wname,fname,mname,address,city,pincd,dist,state) {

var refidfrm = db.users.count() + 1;

if (db.users.findOne({
	id: id
})) return 0; 
// save the user to DB
var savedUser = db.users.save({
	refid: refidfrm,
	id: id,
	name: name,
	wifename: wname,
	fathername: fname,
	mothername: mname,
	address: address,
	city: city,
	pincode: pincd,
	district: dist,
	state: state
});
return 1; 

};

When i run the application in developermode it works fine after packing the application i find this problem.

skmani avatar Feb 07 '17 06:02 skmani