1

ユーザー コレクションのプロファイル フィールドに入力しています。プロファイル内では、場所フィールドの個別の値を取得したいと考えています。移入内で個別を使用することは可能ですか? そうでなければ、どうすれば同じことを達成できますか?

User.find({roles:'service_provider'}).select('profile').populate('profile','location').exec(function(err,locations){
  if(err){
        return res.status(400).send({
           message: errorHandler.getErrorMessage(err)
       });
  }
    locations = locations.filter(function (doc) {
       return doc.profile;
   });

  res.jsonp({locations:locations});
 });

前もって感謝します。

4

0 に答える 0