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