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

Popular posts from this blog

Prolog - Listing -

python - can't seem to get an output from my class -

orchardcms - change base url in local copy in Orchard CMS -