0

.save()ed フィールドが削除されたクエリから取得された mongoose ドキュメントで、.select()不完全なドキュメントが mongo でのドキュメントの表現に上書きされますか?

その場合、フィールド選択を使用しないか、.update()個別に発行する必要があるということですか?

例えば

Posts
  .findById(someId)
  .select('-body')
  .exec(function(err, post){
    post.edited = Date.now();
    post.save(function(err){
      // will `post` still have the body field if I query for it from the database again?
    })
  })
4

1 に答える 1