Answer the question
In order to leave comments, you need to log in
What is the difference when accessing a collection then() or .exec()?
Works both and everything together
Coll.find().exec()
Coll.find().then()
Coll.find().exec().then()
Coll.find().then(/**blablabla**/).catch(/**throw**/)
Coll.find().exec().then(/**blablabla**/).catch(/**throw**/)
Answer the question
In order to leave comments, you need to log in
Just short for
I do it myself.
then(thenFn, catchFn) {
return Promise.resolve(this.run()).then(thenFn, catchFn);
}
Query.prototype.then = function(resolve, reject) {
return this.exec().then(resolve, reject);
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question