Skip to content Skip to sidebar Skip to footer

Trouble Using Promises With Mongoose

Can someone tell me why this promise setup doesn't work. It supposed to remove the docs then add it then find it then console it. It's not consoling the data. var Comp = require(

Solution 1:

Model.create returns a promise, so there's no need to call .exec() on the return value.

.then(function(){
    return Comp.create(arr);
})

Post a Comment for "Trouble Using Promises With Mongoose"