node.js - Get the id of a saved object using Sails -
if save object that:
pet.create({name:'pinkie pie',color:'pink'}).exec();   how can retrieve id of saved object without perform query?
i solved passing anonymous function callback:
pet.create({name:'pinkie pie',color:'pink'}).exec(function createcb(err,pet) {     console.log(pet.id); }      
Comments
Post a Comment