You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-11Lines changed: 31 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,38 +2,58 @@
2
2
3
3
## What is ddev-mongo?
4
4
5
-
This repository provides Mongo and Mongo Express add-on to [DDEV](https://ddev.readthedocs.io).
5
+
This repository provides Mongo and Mongo Express add-on to [DDEV](https://ddev.readthedocs.io/en/stable/).
6
6
7
7
It's based on [MongoDb from Docker Hub](https://hub.docker.com/_/mongo?tab=description#-via-docker-stack-deploy-or-docker-compose), [DDEV custom compose files](https://ddev.readthedocs.io/en/stable/users/extend/custom-compose-files/) and [API Platform tutorial](https://api-platform.com/docs/core/mongodb/#enabling-mongodb-support).
8
8
9
+
## Installation
10
+
11
+
For DDEV v1.23.5 or above run
12
+
13
+
```bash
14
+
ddev add-on get ddev/ddev-mongo
15
+
```
16
+
17
+
For earlier versions of DDEV run
18
+
19
+
```bash
20
+
ddev get ddev/ddev-mongo
21
+
```
22
+
23
+
Then restart your project
24
+
25
+
```bash
26
+
ddev restart
27
+
```
28
+
9
29
## Configuration
10
30
11
31
1. Your project will likely require the [Doctrine MongoDB ODM bundle](https://github.com/doctrine/DoctrineMongoDBBundle)
2. In your application `.env` or other client, set the connection string:
15
35
16
-
```
17
-
MONGODB_URL=mongodb://db:db@mongo:27017
18
-
MONGODB_DB=api
19
-
```
20
-
21
-
Mongo Express will now be accessible from `http://<project>.ddev.site:9091`
36
+
```
37
+
MONGODB_URL=mongodb://db:db@mongo:27017
38
+
```
22
39
40
+
Mongo Express will now be accessible by running `ddev mongo-express` command.
23
41
24
42
## Features
25
43
26
44
### `ddev mongosh` command
27
45
28
46
This command will run the `mongosh` (mongoDB Shell) command in the `mongo` container. Please [read the documentation](https://www.mongodb.com/docs/mongodb-shell/) for more information.
29
47
48
+
### `ddev mongo-express` command
30
49
31
-
## Caveats:
50
+
This command opens your browser to the Mongo Express page.
32
51
33
-
* The php extension (phpX.X-mongodb) is set up in `.ddev/config.mongo.yaml` using `webimage_extra_packages`. If you have an earlier `webimage_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.
34
-
* You can't define custom MongoDB configuration with this current setup.
35
-
* You can't use `ddev import-db` to import to mongo.
52
+
## Caveats:
36
53
54
+
- The php extension (phpX.X-mongodb) is set up in `.ddev/config.mongo.yaml` using `webimage_extra_packages`. If you have an earlier `webimage_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.
55
+
- You can't define custom MongoDB configuration with this current setup.
56
+
- You can't use `ddev import-db` to import to mongo.
37
57
38
58
**Based on the original [ddev-contrib recipe](https://github.com/ddev/ddev-contrib/tree/master/docker-compose-services/mongodb)**
0 commit comments