我在数据库中插入了一些数据,但我的问题是何时要撤回它。
我使用findOneById方法、findAll方法和下面的错误遵循了正式文档
Attempted to call an undefined method named "findAll" of class "Doctrine\ODM\MongoDB\Query\Builder
我的控制器如下所示:
$export = $this
->get('doctrine_mongodb')
->getManager()
->createQueryBuilder('NeoNasaBundle:Neorepo');
$aff = $export->findAll();我要在今晚之前完成一个项目然后变得诡计多端..。
如果你需要一些细节,我会编辑这篇文章。
谢谢你的支持
发布于 2016-08-29 00:07:30
假设您使用的是最新的DoctrineMongoDBBundler,那么您应该通过存储库对象访问find()、findOneById()、findOneByName()或findAll()。使用您的例子:
$export = $this->get('doctrine_mongodb')
->getManager()
->getRepository('NeoNasaBundle:Neorepo')
$aff = > $export->findAll(); 如果这没有帮助,您需要提供Doctrine和MongoDB的版本。
https://stackoverflow.com/questions/39194469
复制相似问题