After Creating Model and using create() method to store data , but as soon as i execute save() method it is not going inside save method , I don't know what is an issue.
var model = require('model');
var Listing = function(){
this.defineProperties({
name: { type: 'string', required: true },
age : {type:'number',required : true}
});
this.setAdapter('postgres', {
host: 'xxx.xxx.xx.xx',
username: 'postgres',
password: 'xxxxxxx',
database: 'xxxxxxx'
});
//Connection Status : Success
};
Listing = model.register('Listing',Listing);
var list = Listing.create({
name : 'xyz',
age : 20
});
list.save(function (err, data) {
if (err) {
throw err;
}
console.log('New item saved!');
});
After Creating Model and using create() method to store data , but as soon as i execute save() method it is not going inside save method , I don't know what is an issue.