정기 Relationship
필드를 저장하지 :KeystoneJS 관계 필드 (이 예에서는 <code>categories</code>) 빈 값을 <a href="http://keystonejs.netlify.com/api/field/relationship/" rel="nofollow noreferrer">KeystoneJS</a>에
Post.add({
author: { type: Types.Relationship, ref: 'User' },
categories: { type: Types.Relationship, ref: 'PostCategory', many: true }
});
처음에는 비어,하지만 난 그것에 어떤 가치를 추가 할 때, 저장 및 (그래서 다음 지우기 해당 필드가 다시 비어 있음)이 모델을 저장하면 categories
이 업데이트되지 않습니다. Post.schema.pre('save', ...
에서
console.log(this.categories)
는 하면서 비어 있어야합니다, this.categories
이전 값이 있는지 보여줍니다.
이 동작에 대한 아이디어?