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",
}]
}
如何让mongoose不在帖子内创建_id
?