Question

I'm using MongoDB in my project but apparently Doctrine update their bundle and now I'm having issues if I run "composer update" command. This is my doctrine.yml file:

# ODM
doctrine_odm.mongodb:
  connections:
    default:
      server: mongodb://%mongo_host%:%mongo_port%
      options: {}
  default_database: %mongo_database%
  document_managers:
    default:
      auto_mapping: true

But I get this error:

[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException] There is no extension able to load the configuration for "doctrine_odm.mongodb" (in /var/www/html/kraken/app/config/doctrine.yml).

If I use this other configuration:

# ODM
doctrine_mongodb:
  connections:
    default:
      server: mongodb://%mongo_host%:%mongo_port%
      options: {}
  default_database: %mongo_database%
  document_managers:
    default:
      auto_mapping: true

Then the error transform to this one:

[Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException] The service "doctrine_mongodb.odm.default_configuration" has a dependency on a non-existent parameter "doctrine_mongodb.odm.default_commit_options". Did you mean one of these: "doctrine_mongodb.odm.default_connection", "doctrine_mongodb.odm.default_document_manager"?

What I'm doing wrong or what I'm missing?

Was it helpful?

Solution

Just add (I have had the same problem few minutes ago when I ran composer update):

doctrine_mongodb:
    default_commit_options: ~

OTHER TIPS

Quick answer. This seems to be a known issue.

https://github.com/doctrine/DoctrineMongoDBBundle/issues/222

The solution is to add a default option:

doctrine_mongodb:

default_commit_options: ~
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top