--- title: GETTING STARTED MONGODB description: Introduction about MongoDB tags: blog , 2020 --- # GETTING STARTED MONGODB # Tools Overview ## Tools 1. MongoDB Atlas 2. MongoDB Compass 3. Mongo Shell ## MongoDB Atlas ### What is Atlas? > MongoDB Atlas is a plaform that provides an interface to manage and deploy MongoDB across cloud provides and regions. * Database as a Service * Help you easily setup and manage your database * Free Tier subscription to setup a database, view and modify data * Also use for **large scale deployment** with other subscription options ## MongoDB Compass 1. Graphical User Interface for exploring your data 2. No need to formal knowledge of the MongoDB query syntax 3. Use Compass for: * Optimize queries * Manage indexes * Explore your data ## Mongo Shell * Interactive JavaScript interface to MongoDB * In this course we will: * Connect to an Atlas instance * Query and update data * Import a dataset into your Atlas instance ## Setup ### Window [Click here to set up your MongoDB](https://university.mongodb.com/mercury/M001/2020_April_14/chapter/Chapter_0_Setup/lesson/5963b30cc1da5a32116dc5bb/lecture) ### Linux & MacOS [Click here to set up your MongoDB](https://university.mongodb.com/mercury/M001/2020_April_14/chapter/Chapter_0_Setup/lesson/5963b30cc1da5a32116dc5b5/lecture) ## Connect to Server MongoDB You can use Command Prombt or Git Bash to use MongoDB ### Command Prombt ( Window User ) Start your `Command Prombt` in Window and run this code: ``` mongo --nodb ``` Command Prombt will return: ``` MongoDB shell version v4.2.5 connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("f0a787ad-0a5c-4c2e-bafe-6ee3ace81a18") } MongoDB server version: 4.2.5 Server has startup warnings: 2020-04-20T09:55:42.034+0700 I CONTROL [initandlisten] 2020-04-20T09:55:42.034+0700 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. 2020-04-20T09:55:42.034+0700 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted. 2020-04-20T09:55:42.034+0700 I CONTROL [initandlisten] --- Enable MongoDB's free cloud-based monitoring service, which will then receive and display metrics about your deployment (disk utilization, CPU, operation statistics, etc). The monitoring data will be available on a MongoDB website with a unique URL accessible to you and anyone you share the URL with. MongoDB may use this information to make product improvements and to suggest MongoDB products and deployment options to you. To enable free monitoring, run the following command: db.enableFreeMonitoring() To permanently disable this reminder, run the following command: db.disableFreeMonitoring() --- > ``` Or you would like to connect your MongoDB, run this code instead: ``` mongo mongodb://$[hostlist]/$[database]?replicaSet=$[replicaSet],authSource=$[authSource],ssl=true --username $[username] --password ``` Now you are able to use MongoDB. ### Git Bash Open your ` Git Bash ` and run this code: ``` mongo --nodb ``` Git Bash will return: ``` MongoDB shell version v4.2.5 connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb Implicit session: session { "id" : UUID("02bdd8cf-576b-492a-88df-b7e26b191737") } MongoDB server version: 4.2.5 ``` Or you would like to connect your MongoDB, run this code instead: ``` mongo mongodb://$[hostlist]/$[database]?replicaSet=$[replicaSet],authSource=$[authSource],ssl=true --username $[username] --password ``` Now let's start your work! *** ### Reference [University MongoDB - Chapter 0: Setup - Tool Overview](https://university.mongodb.com/mercury/M001/2020_April_14/chapter/Chapter_0_Setup/lesson/5e387c3004e9ff815169fd04/lecture) [Connect to your MongoDB instance](https://docs.mongodb.com/guides/server/drivers/) ### Read more [MongoDB Wikipedia](https://en.wikipedia.org/wiki/MongoDB) ###### tags: `blog` `2020`