express

execPopulate() /mongoose.

mooonQ 2020. 4. 29. 10:29

Document.prototype.execPopulate()

 

Parameters

  • [callback] «Function» optional callback. If specified, a promise will not be returned

Returns:

  • «Promise» promise that resolves to the document when population is done

Explicitly executes population and returns a promise. Useful for ES2015 integration.

 

Example:

const promise = doc.execPopulate({ path: 'company', select: 'employees' });

// summary promise.then(resolve,reject);

 

https://mongoosejs.com/docs/api/document.html#document_Document-execPopulate