我想只是把对象为对象的数组中的mongodbMongoDb:如何将附加对象插入到golang中的对象集合中?
{
"_id" : ObjectId("51c9cf2b206dfb73d666ae07"),
"firstName" : "john",
"lastName" : "smith",
"ownerEmail" : "[email protected]",
"camps" : [
{
"name" : "cubs-killeen",
"location" : "killeen"
},
{
"name" : "cubs-temple",
"location" : "temple"
}
],
"instructors" : [
{
"firstName" : "joe",
"lastName" : "black"
},
{
"firstName" : "will",
"lastName" : "smith"
}
]
}
和推对象到需要上述文件做
db.stack.update({"ownerEmail":"[email protected]"},
{$push: {
"camps":{ "name":"cubs-killeen","location":"some other Place" }
}
}
)
所以,我怎么能使用氧化镁实现相同的功能驱动程序
有没有必要[标题前加问题标签](http://meta.stackexchange.com/questions/19190/should-questions-include-tags-in-their-titles),请编辑标题。另外,请不要滥用** bold **标记。 –