我在此之後文檔非規範化的數據在MongoDB中學說的Symfony 2
而且
http://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html
當我保存我的文檔,我有兩個Collection
這樣的:
{
"_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
}
]
}
我想我的非規範化的數據。我該怎麼做?
我可以像使用$推的方法,$ addToSet的MongoDB等?
感謝
好評!我可以在同一個項目中使用MySQL和mongodb嗎? – Barno 2014-11-13 08:07:50
絕對。 Steve Francia關於[將MongoDB與RDBMS融合用於電子商務]的演講(http://www.mongodb.com/presentations/blending-mongodb-rdbms-e-commerce)描述了我們如何在OpenSky中做到這一點。具體到Doctrine ODM,有兩篇關於[映射到ODM和ORM]的文檔文章(http://doctrine-mongodb-odm.readthedocs.org/en/latest/cookbook/blending-orm-and-mongodb-odm。 html)和[混合ODM和ORM](http://doctrine-mongodb-odm.readthedocs.org/en/latest/cookbook/blending-orm-and-mongodb-odm.html),這可能有助於進一步閱讀。 – jmikola 2014-11-13 17:11:34