Consistently use / in MongoDB URIs (#4759)

This commit is contained in:
Alexey Palazhchenko authored and GitHub committed 2025-02-13 02:31:10 +00:00
1 parent 6bc29eb0b6
commit d94e91b1fd
3 files changed
+7 -7

No files matched your search

@@ -21,10 +21,10 @@ Before you go forward with the migration, you need to have the following:
## Backup your MongoDB data
To backup your MongoDB instance using `mongodump` or `mongoexport`, you'll need to set the connection string to your MongoDB instance (e.g. `"mongodb://127.0.0.1:27017"`) to run the following command:
To backup your MongoDB instance using `mongodump` or `mongoexport`, you'll need to set the connection string to your MongoDB instance (e.g. `"mongodb://127.0.0.1:27017/"`) to run the following command:
```sh
mongodump --uri="mongodb://<yourusername>:<yourpassword>@<host>:<port>"
mongodump --uri="mongodb://<yourusername>:<yourpassword>@<host>:<port>/"
```
The `mongodump` command will create a dump of all the data in the instance, consisting of BSON files of all the collections.
@@ -35,7 +35,7 @@ If you include the database in your connection string, there's no need to specif
:::
```sh
mongoexport --uri="mongodb://<yourusername>:<yourpassword>@<host>:<port>" --db=<database-name> --collection=<collection-name> --out=<collection>.json
mongoexport --uri="mongodb://<yourusername>:<yourpassword>@<host>:<port>/" --db=<database-name> --collection=<collection-name> --out=<collection>.json
```
On the other hand, `mongoexport` does not provide a direct way to export all the collections at once, like `mongodump` does.
@@ -33,9 +33,9 @@ You would do the following:
```sh
ferretdb --mode=diff-normal \
--proxy-addr=<mongodb-URI> \
--listen-addr=<ferretdb-listen-address> \
--postgresql-url=<postgres_connection>
--proxy-addr=<mongodb-URI> \
--listen-addr=<ferretdb-listen-address> \
--postgresql-url=<postgres-connection>
```
The `--listen-addr` flag or the `FERRERDB_LISTEN_ADDR` environment variable is set to `127.0.0.1:27017` by default.
+1 -1
View File
@@ -98,5 +98,5 @@ docker run --rm -it \
--network=ferretdb \
--volume ./client-certs:/clients \
--entrypoint=mongosh \
mongo 'mongodb://username:password@host.docker.internal:27018?tls=true&tlsCertificateKeyFile=/clients/client.pem&tlsCaFile=/clients/rootCA-cert.pem'
mongo 'mongodb://username:password@host.docker.internal:27018/?tls=true&tlsCertificateKeyFile=/clients/client.pem&tlsCaFile=/clients/rootCA-cert.pem'
```