Thing.observe("before delete", function (ctx, next) { console.log("BEFORE delete"); var id = ctx.where.id; Thing.findById(id, function (err, element) { if (element) console.log("COPY NOW"); next(); }); next(); });
but I'm fighting with asynchronous methods. How I can ensure to invoke next() only inside the callback of findById ??
Many thanks!Claudio