问题
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