tester
tester

Reputation: 3987

Doctrine ODM: How to select Mongo DB database

I use doctrine ODM to persist and load documents from my Mongo DB. I followed this guide: https://doctrine-mongodb-odm.readthedocs.org/en/latest/tutorials/getting-started.html

Following this guide all documents get stored in the database "doctrine" by default. But what if I have my own database? How do I select the database? I couldn't find anything use in the documentation nor google.

Upvotes: 2

Views: 643

Answers (1)

mpm
mpm

Reputation: 20155

you can use the Configuration class.

$config->setDefaultDB('mydbname');

Upvotes: 2

Related Questions