Posts

Featured Post

Basic Setup for Java on Mac and Windows

Image
  Basic Setup for Java on Mac It outlines the basic software tools required to build and manage your Java Projects on Mac. Make sure the user has admin privileges before you move to below sections. Homebrew Homebrew, an open source, simplifies the installation of several software on your mac.  Learn more about brew on https://brew.sh/ ;no more using sudo command.  Open a terminal and run the below command to install Homebrew. Please note that it might take upto 15 minutes to install Homebrew. $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )" $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" In the end, it will display the below messages: Java Now, you have installed homebrew, use the same terminal or open a new terminal, and  use the below command to verify which version of java is already installed. $ brew cask info java The command will output the details of the...

Working with mongo shell

Prerequisite :  Visit my blogs  Install Run and Connect to MongoDB on Mac              OR   Install Run and Connect to MongoDB on Windows Create mongo database and user After connecting to mongo shell using the command " $ mongo" , follow the below instructions to  create mongo database and user. Show all databases Print a list of all databases on the server. > show dbs Output : admin 0.000GB config 0.000GB local 0.000GB To display the database you are using, type db : The operation should return ‘test’, which is the default database. > db Output : test S witch databases To switch databases, type the ‘use <db>’ helper: > use test Output : switched to db test   Create Admin user with access to any database > use admin Output : switched to db admin > db Output : admin Create Admin user . >  db.createUser({user:"admin",pwd:"admin",roles:[{role:"userAdminAnyDatabase",db:" admin"},"re...

Install, Run and Connect to MongoDB on Windows

Image
Updated: Nov 24 2021 Install MongoDB    From a command prompt or PowerShell as Administrator, type the below command to install MongoDB   C:\...> choco install mongodb     Once installation is completed, verify that MongoDB installation location is : “C: \Program Files\MongoDB\Server\{version}\bin” Verify MongoDB is running as service Search for Services next to the Windows button and open the Services:      Once Services are open look for "MongoDB Server" and verify that status is running:   Connect to MongoDB using mongo shell To begin using MongoDB, connect a mongo shell (client) to the running instance.  Type below command from a new command prompt or PowerShell tab:   C:\...> "C:\Program Files\MongoDB\Server\5.1\bin\mongo.exe"  

Install, Run and Connect to MongoDB on Mac

Image
Updated: Nov 18,  2021 Tap the MongoDB Give the below command from the terminal to tap the official MongoDB Homebrew Tap $ brew tap mangodb/brew Install MongoDB From a terminal, type the below command to run MongoDB (i.e. the mongod process) in the foreground. $ brew install mongodb-community@5.0 Run MongoDB From a terminal, type the below command to run MongoDB (i.e. the mongod process) in the foreground. Go to root and execute  mongodb command $ cd ~ $ mongod --config /usr/local/etc/mongod.conf Connect to MongoDB using mongo shell To begin using MongoDB, connect a mongo shell to the running instance.  From a new terminal, execute the below command: $ mongo MongoDB shell version v5.0.3 connecting to: mongodb://127.0.0.1:27017 Implicit session: session { "id" : UUID("f8e6ee1b-f300-471d-bf25- e97da6b68134") } MongoDB server version: 5.0.3 Server has startup warnings: 2021-11-18T14:13:15.438-0700 I CONTROL [initandlisten] 2021-11-18T14:13:15.438-0700 I CONTROL [initan...