原则 2 ODM - 保存嵌套嵌入文档适用于开发环境,但不适用于生产环境
如果有一条看起来像这样的记录:
{
'title' :'test',
'subdoc' :[{
'title' : 'sub test',
'subdoc2' : [{
'title' : 'sub 2 test';
}]
}]
}
我为学说设置了相应的实体,其中 subdoc 是根文档的 EmbedMany,subdoc2 是 subdoc 的 EmbedMany。
它在我的开发环境中运行得很好。在生产环境中,它不保存subdoc2。我可以创建它,将其添加到子文档中,并告诉它刷新,没有错误,但它只是不保存。
我已经排除的事情:
- 这不是学说:两个环境都使用相同版本的学说,完全相同的文件
- 这不是mongo:相同版本的mongo php驱动程序:1.2.2(相同的配置)
- 都在ubuntu上使用apache2
- 它可以'这不是我的代码,可以吗?我的意思是两台机器上都有相同的代码
可能是:
- 生产:PHP 版本 5.3.5-1ubuntu7.2;开发:PHP 版本 5.3.5
- 生产实际上是 Zend Server,开发则不是。我确实无法控制这一点,但也许 Zend Server 中的某些设置可能会导致问题?我很乐意发布具体设置,但它们有很多,所以我不想发布所有设置,除非需要它们。
我真的很茫然!请帮忙。
if have a record that looks something like this:
{
'title' :'test',
'subdoc' :[{
'title' : 'sub test',
'subdoc2' : [{
'title' : 'sub 2 test';
}]
}]
}
I have the corresponding entities set up for doctrine, where subdoc is an EmbedMany of the root document and subdoc2 is an EmbedMany of subdoc.
It works great in my development environment. In the production environment, it dosn't save the subdoc2. I can create it, add it to the subdoc, and tell it to flush, no errors, but it just simply doesn't save.
Things I've ruled out:
- It's not doctrine: both environments are using the same version of doctrine, exact same files
- It's not mongo: same version of mongo php driver: 1.2.2 (same configuration)
- both using apache2 on ubuntu
- It can't be my code, could it? I mean the same code is on both machines
Things it could be:
- Production: PHP Version 5.3.5-1ubuntu7.2; Dev: PHP Version 5.3.5
- Production is actually Zend Server, development is not. I don't really have control over that, but maybe there are some settings in Zend Server that might be causing problems? I'de be happy to post specific settings, but there are a lot of them so I don't want to post them all unless they are needed.
I'm really at loss! Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,mongodb 服务器的版本不同。按照此处的说明进行操作,现在它可以工作了。
As it turns out, the version of mongodb server where different. Followed directions here and now it works.