Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mongodb): Update documentation about connection string #4387

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categories:
---

<Message type="important">
Managed MongoDB® is currently in private beta. Click [here](https://www.scaleway.com/en/managed-mongodb/) to join the waiting list.
Managed MongoDB® is currently in public beta. Click [here](https://www.scaleway.com/en/managed-mongodb/) to join the waiting list.
</Message>

<Macro id="requirements" />
Expand Down Expand Up @@ -44,7 +44,7 @@ To connect to a public endpoint using the MongoDB® shell:

1. Replace the following variables in the command as described:
```sh
mongosh "mongodb+srv://{instance_id}.mgdb.{region}.scw.cloud" --tlsCAFile {your_certificate.pem} -u {username}
mongosh "mongodb+srv://{db-instance-id}.mgdb.{region}.scw.cloud" --tlsCAFile {your_certificate.pem} -u {username}
```

- `{your-certificate.pem}` - the TLS certificate downloaded on **step 3**.
Expand All @@ -57,20 +57,26 @@ To connect to a public endpoint using the MongoDB® shell:

If the connection is successful, you should see the following message display on your console, and be able to write queries:
```sh
The server generated these startup warnings when booting
Powered by MongoDB® v0.9.0 and PostgreSQL 14.6.
Current Mongosh Log ID: 67ab0096d43bcc1d9ed4336d
Connecting to: mongodb+srv://<credentials>@{db-instance-id}.mgdb.{region}.scw.cloud/?appName=mongosh+2.3.8
Using MongoDB: 7.0.12
Using Mongosh: 2.3.8

For mongosh info see: https://docs.mongodb.com/mongodb-shell/

rs-{db-instance-id} [primary] test>
```

Follow the same procedure to connect to a private endpoint for one node, replacing `{privateNetorkName}` with the name of your Private Network:
Follow the same procedure to connect to a private endpoint for one node, replacing `{privateNetworkId}` with the `ID` of your Private Network:

```sh
mongosh "mongodb://{instance_id}-0.{privateNetworkName}" -u {username}
mongosh "mongodb://{db-instance-id}-0.{privateNetworkId}" -u {username} --tlsCAFile {your_certificate.pem}
```

For multiple nodes, replace `{db-instance-id}` with the Database Instance UUID of each respective Instance, and `{privateNetworkName}` with the names of your Private Network:
For multiple nodes, replace `{db-instance-id}` with the Database Instance UUID of each respective Instance, and `{privateNetworkId}` with the `ID` of your Private Network:

```sh
"mongodb://{instance_id}-0.{privateNetworkName},{instance_id}-1.{privateNetworkName},{instance_id}-2.{privateNetworkName}" -u {username}
"mongodb://{db-instance-id}-0.{privateNetworkId},{db-instance-id}-1.{privateNetworkId},{db-instance-id}-2.{privateNetworkId}" -u {username} --tlsCAFile {your_certificate.pem}
```

### Python
Expand Down Expand Up @@ -272,4 +278,4 @@ exampleDoc.save()
.catch(err => {
console.error('Error saving document', err);
});
```
```