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 -

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

linear regression - Trying to get confidence/prediction intervals with `predict.lm` in R, but I keep getting an error regarding my dichotomous variable -