I'm still learning to understand NodeJs/SailsJs, sorry if these sound too stupid but I can't seem to search google for a better explanation. I have tried searching for node OOP programming but doesn't seems to explain.
Taking the following query code
Company.findOne({'id':req.param('id')}).then(function(results){
console.log(util.inspect(results, true, null))
})
The output will be
{ id: 1,
companyName: 'Wunly Enterprise1',
createdAt: null,
updatedAt: Wed Jul 08 2015 01:43:19 GMT+0800 (SGT) }
But in SailJs, I can use the following code to update the record
results.name = "change name";
results.save(function(err,newresult){})
Howcome I am able to call save method when I console.log and there are no such method exists??