Skip to content

Commit

Permalink
Fix README command syntax and simplify MongoDB connection options
Browse files Browse the repository at this point in the history
  • Loading branch information
KilianBoute committed Feb 18, 2025
1 parent 67ec977 commit e47094a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ go run main.go -action vault-to-hub-migration \
-end-timestamp <endTimestamp> \
-timezone <timezone> \
-pipeline 'monitor,sequence,analysis' \
-mode 'dry-run' \
-mode dry-run \
-batch-size 100 \
-batch-delay 1000
```
Expand Down Expand Up @@ -171,7 +171,7 @@ To run the default label generation, use the following command:

```sh
go run main.go -action generate-default-labels \
-mode 'dry-run' \
-mode dry-run \
-mongodb-uri "mongodb+srv://<username>:<password>@<host>/<database>?retryWrites=true&w=majority&appName=<appName>" \
-mongodb-source-database=<sourceDatabase> \
-label-names=<labelNames> \
Expand Down
3 changes: 1 addition & 2 deletions database/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ func NewMongoDB(uri string, host string, port string, databaseCredentials string
// We can also apply the complete URI
// e.g. "mongodb+srv://<username>:<password>@kerberos-hub.shhng.mongodb.net/?retryWrites=true&w=majority&appName=kerberos-hub"
if uri != "" {
serverAPI := options.ServerAPI(options.ServerAPIVersion1)
opts := options.Client().ApplyURI(uri).SetServerAPIOptions(serverAPI)
opts := options.Client().ApplyURI(uri)

// Create a new client and connect to the server
client, err := mongo.Connect(ctx, opts)
Expand Down

0 comments on commit e47094a

Please sign in to comment.