如题,我知道如下这样可以在文档中嵌入一个文档:db.insertdb.insert({_id:2,by:'测试',auther:{name:'小明',age:23}})但不知怎么嵌入多个,还有如何在一个已有文档中新添一个子文档,求mongodb前辈告知,多谢!
db.insertdb.insert({_id:2,by:'测试',auther:{name:'小明',age:23}})
Save author as array author: [{name: 1},{name:2}]
author: [{name: 1},{name:2}]
mongodb has $push operation
Save author as array
author: [{name: 1},{name:2}]
mongodb has $push operation