I am doing my first steps with mongodb in symfony 2.4, following the manual instructions here. After successfully setting up and running mongodb server, I am trying to generate my first getters and setters with the following instruction:
php app/console doctrine:mongodb:generate:documents AcmeDemoBundle
But all I get is this error message:
[Symfony\Component\Config\Definition\Exception\InvalidTypeException]
Invalid type for path "doctrine_mongodb.connections.default_database".
Expected array, but got string
Here is what seems to be my conflicting configuration:
# Doctrine Mongo DB Configuration
doctrine_mongodb:
connections:
default:
server: mongodb://localhost:27017
options: {}
default_database: test_database
document_managers:
default:
auto_mapping: true
namely:
default_database: test_database
It sounds strange that a default database is expected to be an array. I tried this anyway
default_database: [ test_database ]
and got this other error message:
[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
Unrecognized options "0" under "doctrine_mongodb.connections.default_database"
This post about mongdb doctrine configuration gives a lot of info about more advanced options. I tried another database name:
default_database: hello_%kernel.environment%
with no more luck (got the first error message).
Any idea what I am doing wrong ? Any hint will be welcome ! Thanks.