1
new mongoose.Schema({
  name: String,
  posts: [{
    title: String,
    body: String,
  }]
})

私は次のようなものを取得します

{
  "_id": ObjectId("xxx"), // which is OK
  "name": "xxx",
  "posts": [{
    "_id": ObjectId("yyy"), // which is what I dont want
    "title": "ttt",
    "body": "bbbb",
  }]
}

どうすればマングースが_id内部の投稿を作成しないようにできますか?

4

0 に答える 0