Sonata Seo Bundle with MongoDB giving database connectivity error in sitemap with Symfony 3.4

不打扰是莪最后的温柔 提交于 2021-01-28 17:37:42

问题


I am trying to connect Sonata Seo Bundle with MongoDB in Symfony 3.4 and try to generate sitemap through it.

But I am getting error as follows:

  Type error: Argument 1 passed to Sonata\Exporter\Source\DoctrineDBALConnectionSourceIterator::__construct() must be an instance of Doctrine\DBAL\  
  Driver\Connection, instance of MongoDB\Client given, called in var/cache/dev/ContainerXocz3o4/getSonata_Seo_Source_Do  
  ctrineSitemapIterator0Service.php on line 8  

Sotana Seo Configuration is as follows:

sonata_seo:
    sitemap:
        doctrine_orm:
            - group: "news"
              connection: doctrine_mongodb.odm.default_connection
              route: home
              parameters: {}
              query: db.some_collection.find( {} ).limit(2)

Any help is much appreciated.

来源:https://stackoverflow.com/questions/61482740/sonata-seo-bundle-with-mongodb-giving-database-connectivity-error-in-sitemap-wit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!