Skip to content

Commit

Permalink
Merge pull request #203 from ballerina-platform/lakshanss-connectionS…
Browse files Browse the repository at this point in the history
…tring

Rename as ConnectionString and remove samples
  • Loading branch information
LakshanSS authored Oct 11, 2022
2 parents 7d31b2d + 5524b4c commit 29258e9
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 353 deletions.
23 changes: 14 additions & 9 deletions mongodb/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,21 @@ To use the MongoDB client you need to specify the database it needs to connect t

```ballerina
mongodb:ConnectionConfig mongoConfig = {
host: <YOUR_HOST_NAME>,
port: <PORT>,
username: <DB_USERNAME>,
password: <DB_PASSWORD>,
options: {sslEnabled: false, serverSelectionTimeout: 5000}
connection: {
host: <YOUR_HOST_NAME>,
port: <PORT>,
auth: {
username: <DB_USERNAME>,
password: <DB_PASSWORD>
},
options: {
sslEnabled: false,
serverSelectionTimeout: 5000
}
},
databaseName: DATABASE_NAME>
};
string database = <DATABASE_NAME>
mongodb:Client mongoClient = check new (mongoConfig, database);
mongodb:Client mongoClient = check new (mongoConfig);
```

### Step 3: Invoke connector operation
Expand All @@ -53,5 +60,3 @@ Following is an example on how to insert a document into a collection using the
}
```
2. Use `bal run` command to compile and run the Ballerina program.

**[You can find a list of samples here](https://github.com/ballerina-platform/module-ballerinax-mongodb/blob/master/mongodb/samples/)**
35 changes: 0 additions & 35 deletions mongodb/samples/count_documents.bal

This file was deleted.

41 changes: 0 additions & 41 deletions mongodb/samples/delete.bal

This file was deleted.

36 changes: 0 additions & 36 deletions mongodb/samples/get_all_collection_names.bal

This file was deleted.

34 changes: 0 additions & 34 deletions mongodb/samples/get_all_db_names.bal

This file was deleted.

41 changes: 0 additions & 41 deletions mongodb/samples/insert.bal

This file was deleted.

44 changes: 0 additions & 44 deletions mongodb/samples/list_indices.bal

This file was deleted.

56 changes: 0 additions & 56 deletions mongodb/samples/query.bal

This file was deleted.

54 changes: 0 additions & 54 deletions mongodb/samples/update.bal

This file was deleted.

Loading

0 comments on commit 29258e9

Please sign in to comment.