【发布时间】:2014-12-31 12:03:58
【问题描述】:
我正在关注这个文档
和
http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html
当我保存我的文档时,我有两个集合
像这样:
{
"_id" : ObjectId("5458e370d16fb63f250041a7"),
"name" : "A Foo Bar",
"price" : 19.99,
"posts" : [
{
"$ref" : "Embedd",
"$id" : ObjectId("5458e370d16fb63f250041a8"),
"$db" : "test_database"
}
]
}
我想要
{
"_id" : ObjectId("5458e370d16fb63f250041a7"),
"name" : "A Foo Bar",
"price" : 19.99,
"posts" : [
{
"mycomment" :"dsdsds"
" date" : date
}
]
}
我想对我的数据进行非规范化处理。我该怎么做?
我可以使用 mongoDb 的 $push,$addToSet 等方法吗?
谢谢
【问题讨论】:
标签: mongodb symfony doctrine-orm doctrine