📜  mongoose (populate) - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:49.556000             🧑  作者: Mango

代码示例1
// The 2nd `populate()` call below overwrites the first because they
// both populate 'fans'.
Story.
  find().
  populate({ path: 'fans', select: 'name' }).
  populate({ path: 'fans', select: 'email' });
// The above is equivalent to:
Story.find().populate({ path: 'fans', select: 'email' });