MongoDB
Manage your microservice database using MongoDB
With Grizzly API you can easily create your microservice database using MongoDB in 3 connection modes:
In this example we’re going to create a free database named ProductsDB
Free is a limited offer and is suitable for getting started.
As a second connection mode we’ll connect to an On-Premise Mongo databse (our local database as an example)
We offer you the possibility to use your MongoDB Cluster in Cloud using its URI
Added to Grizzly API, you can use your CLI to manage your Mongo database using these commands
To create a database you can use this command :
grizzly create datasource [-- <args>]
Arguments :
–name : to specify the name of the datasource (required)
–provider : to specify the datasource provider (Example MONGO)
–port : to specify the datasource port
–host : to specify the datasource host
–uri : to specify the Cluster uri
Example :
grizzly create datasource --name ProductsDB --host localhost --port 27017
To update the name of a datasource you can use these commands :
grizzly update datasource [-- <args>]
Arguments :
– name : to specify the name of the datasource to update
– new : to specify the new name
Example :
grizzly update datasource --name ProductsDB --new UsersDB
To delete a datasource you can use this command :
grizzly delete datasource [-- <args>]
Arguments :
– name : to specify the name of the datasource to delete
Example :
grizzly delete datasource --name ProductsDB
To show a specified datasource you can use this command :
grizzly show datasource[-- <args>]
Arguments :
– name : to specify the name of the datasource to show
Example :
grizzly show datasource --name ProductsDB