How to resolve promise from remote method in below the code ?
Model.afterRemote('create', function(context,unused,next){
while (startDay <= endDay) { // day1 to day365
// there are some async operations(loops) which takes some time to execute
next(); // it gets execute before the loop gets finish
});
Using loopback v3
and mongodb v3.
Thanks