Closed gavinaiken closed 8 years ago
This works:
Example.findOne({_id: id}) .exec() .then(found => { found.fill('myRef', (err, filled) => { // filled.myRef is filled }); });
But this does not:
Example.findOne({_id: id}) .exec() .then(found => { return found.fill('myRef); }) .then(filled => { // filled.myRef is not filled, because the document fill method only takes the callback, it doesn't return a promise. }); });
And I do know I can do this:
Example.findOne({_id: id}) .fill('myRef) .exec() .then(filled => { // filled.myRef is filled }); });
but sometimes you have a mongoose document which you want to fill later, not at query time.
(Thanks for the great plugin though, I prefer it to mongoose's populate!)
Ok, I will add it.
Ok, added in 1.5.0 ;)
wow that was quick, thanks! testing...
Works great :)
This works:
But this does not:
And I do know I can do this:
but sometimes you have a mongoose document which you want to fill later, not at query time.
(Thanks for the great plugin though, I prefer it to mongoose's populate!)