This repository provides Mongo and Mongo Express add-on to DDEV.
It's based on MongoDb from Docker Hub, DDEV custom compose files and API Platform tutorial.
-
Your project will likely require the Doctrine MongoDB ODM bundle
ddev composer require doctrine/mongodb-odm-bundle:^4.0.0@beta doctrine/mongodb-odm:^2.0.0@beta
-
In your application
.env
or other client, set the connection string:MONGODB_URL=mongodb://db:db@mongo:27017 MONGODB_DB=api
Mongo Express will now be accessible from http://<project>.ddev.site:9091
This command will run the mongosh
(mongoDB Shell) command in the mongo
container. Please read the documentation for more information.
- The php extension (phpX.X-mongodb) is set up in
.ddev/config.mongo.yaml
usingwebimage_extra_packages
. If you have an earlierwebimage_extra_packages
in your config.yaml, this will override it. You may want to edit your config.yaml to do what you want and remove the config.mongo.yaml. - You can't define custom MongoDB configuration with this current setup.
- You can't use
ddev import-db
to import to mongo.
Based on the original ddev-contrib recipe
Originally contributed by @wtfred
Maintained by @julienloizelet