Do these steps to establish a cloud Mongo account and connect to it from csci.hsutx.edu 1. Visit https://www.mongodb.com/try Register for an account and then sign in 2. Click "Database Access" and establish a mongo user account (pick whatever username/password combo you want ... these values will be stored in a script file so don't choose anything you commonly use other places). 3. Click "Network Access" and whitelist the csci server (whose IP is 209.165.224.128/32) NOTE: It may take a few minutes for the whitelist to become active. 4. We will use some convenient scripts provided on josephus to make it easier to connect to your cloud service from csci.hsutx.edu. a) Log in to csci b) Create a new directory called mongo c) Move into that directory d) Copy three scripts from josephus using these commands: wget https://josephus.hsutx.edu/classes/db/source/mongo/scripts/mongoshell wget https://josephus.hsutx.edu/classes/db/source/mongo/scripts/mongoload wget https://josephus.hsutx.edu/classes/db/source/mongo/scripts/mongoexec e) Take time to skim the overview of these scripts in the document found here: https://josephus.hsutx.edu/classes/db/source/mongo/scripts/README.txt 5. Let's start by getting the mongoshell script you just downloaded to work. a) Edit the file mongoshell and observe you'll need to provide three values: username, password, and uri. The username/password are the values you created in step (2) above. b) To get the URI value go to your cloud mongo account and click "All Clusters" and then click the "Project 0" link. From there click the "Build Database" button. No need to create a new username/password combo ... it will use the one from Step 2 above automatically. Then click "Connect" and then "Connect with the mongo shell" No need to follow all of these steps at this point. Instead just scroll down to step 3 and copy the URI starting with: "mongodb+srv://" but don't include the database name. Paste this value into the appropriate spot in your mongoshell script. c) Set permissions on your scripts to be executable by using these commands: chmod 700 mongoshell chmod 700 mongoload chmod 700 mongoexec d) Run the modified mongoshell script by typing: ./mongoshell NOTE: This should give you a command prompt and allow you to interact with your mongo cluster. Keep modifying your script until you get it to work. e) Copy the working username,password,uri values from your working mongoshell script into the mongoexec and mongoload scripts 6. From a mongo shell opened to the cloud cluster take time to play around with various database commands, including, but not limited to: show dbs use dbname show collections db.colname.find() db.colname.find().pretty db.colname.insertOne() db.colname.insertMany() db.colname.deleteOne() db.colname.deleteMany() db.colname.updateOne() db.colname.updateMany() NOTE: There are lots of JSON-formatted string available here: Feel free to experiment with these. 7. Create a mongo script (using vim or nano) called my_first.js and in it put commands that will: a) use a db called first b) delete all entries in a collection called inventory c) add (to the inventory collection) the values found here: https://josephus.hsutx.edu/classes/db/source/mongo/json/inventory.json d) print (using .pretty()) the contents of the inventory collection found in the database called first. 8. Run the my_first.mongo using: ./mongoexec my_first.js Verify that this script is running without error using that command.