Resids and mango DB homework assignment
1. Install Redis on your machine.
Mac OS: After downloading, open a terminal (click on Go and then on Utilities and then on terminal). Then, follow the following instructions:
https://jasdeep.ca/2012/05/installing-redis-on-mac-os-x/ and https://redis.io/topics/quickstart
Windows: Download executable from here: https://github.com/rgl/redis/downloads and https://stackoverflow.com/questions/6476945/how-do-i-run-redis-on-windows
New versions come out all the time. So, you will have to figure out what is not working on your machine. For example, if your machine does not have XCode on Mac, you may have to download it.
2. Design a Redis database to hold a list of ads and their attributes from statecollege.com auto listings.
3. Choose 4 ads. For example, consider the ad: https://www.statecollege.com/auto/dealers/statecollegemotors-com,6547/audi/a4/cars/WAUENAF40HN029405/. This can be one.
4. Choose the attributes and information present in the ads. You must store at least the following attributes:
(a) Title: 2017 Audi A4 at StateCollegeMotors.com
(b) Description: For example, https://www.statecollege.com/auto/dealers/sutliff-buick-gmc-cadillac,55999/buick/regal/cars/2G4GM5EX2H9116237/ has the
Description: BLUETOOTH!!!, REAR BACK UP CAMERA, 8 COLOR TOUCHSCREEN RADIO, ALL-WHEEL-DRIVE, NAVIGATION, HEATED LEATHER SEATS, and POWER SUNROOF. 2.0L 4-Cylinder DGI DOHC VVT Turbocharged, 6-Speed Automatic, AWD, Light Neutral With Cocoa Interior Accents, 2-Way Adjustable (Up/Down) Front Head Restraints, 2-Way Power Driver Lumbar Seat Adjuster, 4-Wheel Disc Brakes, 7-Speaker Audio System Feature, 8-Way Power Driver Seat Adjuster, ABS brakes, Alloy wheels, Brake assist, Dual front side impact airbags, Electronic Stability Control, Four wheel independent suspension, Front dual zone A/C, Front fog lights, Heated door mirrors, Heated front seats, Leather-Appointed Seat Trim, Outside temperature display, Overhead airbag, Power passenger seat, Power Tilt-Sliding Moonroof w/Sunshade, Radio: Buick IntelliLink AM/FM Stereo w/Navigation, Remote keyless entry, Single-Slot CD/MP3 Player, SiriusXM Satellite Radio, Speed control, Speed-sensing steering, Split folding rear seat, Steering wheel mounted audio controls, Telescoping steering wheel, Traction control, and Turn signal indicator mirrors.Be the talk of the town when you roll down the street in this wonderful 2017 Buick Regal. This spirited machine can turn the everyday driver into a gearhead as they experience a whole new kind of acceleration and exceptionally potent power.We are a Franchised BUICK Dealership for warranty, parts and service.
For ads where there are no descriptions, update your database accordingly. At least choose one ad with a description. If you cannot store very large text, make some assumptions and design decisions, and adjust accordingly. Let us know in your report what design decisions you had to make.
(c) Location of the seller
(d) Year of the Car
(e) Number of miles
(f) An attribute called seller with sub-attributes name, address and phone number
Report: (a) A design document telling us your database design and what choices you made and why, (b) Print out your program/screen shot of what you did and submit.
Homework 4: MongoDB
Problem 1. Run MongoDB Locally
Run a MongoDB instance on localhost so you can connect from a client
Task 1. Install MongoDB for you platform
1. Go to https://www.mongodb.org/downloads
2. Find you platform
3. Download
4. Follow the installer
Task 2. Run a server
If you are using windows and MongoDB is installed in Program Files you'd need to use Administrative role
1. Open command prompt as administrator
2. Navigate to MongoDB root
3. Create a folder "data"
4. Run "mongod -dbpath ../data"
Additional Information:
Here are some resources for installing mongodb on mac:
1) install homebrew (https://brew.sh/index.html)
2) install mongodb with home-brew (https://treehouse.github.io/installation-guides/mac/mongo-mac.html)
3) import restaurant data (https://docs.mongodb.com/getting-started/shell/import-data/)
4) I have tried the top 5 queries, and they look good.
To install mongodb on Windows:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/#install-mongodb-community-edition
To log what you are doing on Unix, please use the script command. Do a "man -k script" to learn more about the script command. The default filename is typescript that is created in the current working directory. You can get the output of script going to a different file by using the command line option.
For logging scripts on windows use powershell:
https://sharepointjack.com/2013/simple-powershell-script-logging/
I do not care which logging script or screenshot you use, but, I need some evidence that all the tasks identified below are done.
Task 3. Practice all of the following exercises
https://www.w3resource.com/mongodb-exercises/
Submit the screenshot. You should do the exercise first and only if you cannot do it, look at the answers.
Task 4. Insert the data that you inserted in your redis database in Hw3 into this MongoDB database.
Task 5.Upsert data (e.g., one record from the car sales website) into your MongoDB database. Perform the same data into your redis database.
Task 6. Query your data from both databases.
Task 7. Query aggregate data for a query of this type. Find me Audis that are under 50,000 miles being sold by a dealer in State College for under $20,000 on both queries. Feel free to change "Audis" to whatever car makes are in your database. Perform the query for one car make in your database and for one car make not in your database.
Submission:
Submit a log of your work. Include a short writeup (if necessary) to help us understand what you did.