Limited Offer Get 25% off — use code BESTW25
No AI No Plagiarism On-Time Delivery Free Revisions
Claim Now
Prices start at $5 per page · plagiarism-free papers · free revisions for 14 days 24/7 support: support@bestwriters.com
Uncategorized

ITP 249 Part 1: MongoDB

  • Posted
  • Authoradmin
  • Length822 words
  • Reading time4 min
Write My Assignment FREE

ITP 249


Part 1: MongoDB

1. Installing STUDIO 3T a Mongo Client on your computer.

  1. Go to https://studio3t.com/download/
  2. Download and install Studio 3T Client on your computer. Use the version corresponding to your OS. i.e. Windows/MacOS/Linux
  3. For Windows only:
    1. Go to https://www.mongodb.com/download-center?jmp=homepage#community
    2. Go to the Products -> Software -> MongoDB Server, then click Download MongoDB
    3. Download and unzip Mongo Community Server that corresponds to your Windows version

*make sure to choose Package: ZIP

  1. Launch Studio 3T, accept terms and finish
  2. You will now connect to the ITP MongoDB server
    1. Click on Connect
    2. Click on New Connection
    3. Enter a name for this connection: ITP 249 MongoDB
    4. Under Server tab
      1. Connection Type: Standard/Direct Connection
      2. Members:
        1. Remove the Localhost
        2. Add a new Member with Server: itpmongodb.usc.edu Port: 27017
    5. Under Authentication tab
      1. Authentication Mode: Basic
      2. Username: your USC email username (e.g. kale)
      3. Password: your 10-digit USC student ID (e.g. 1234567890)
      4. Authentication DB: your USC email username (e.g. kale)
    6. Click on Test Connection. Make sure there is no errors.
    7. Save
    8. Choose the connection you just made. Click Connect.
  3. On the left panel you will see your database.
  1. For Windows only: Now you will configure the IntelliShell where you can issue MongoDB commands.
    1. Go to Menu – Edit – Preferences – Click on IntelliShell
    2. Select Use the following ‘mongo’ executable
    3. Browse to the bin folder of the Mongo Community Server you downloaded and unzipped earlier and find the mongo.exe file, e.g. C:Program FilesMongoDBServer3.4binmongo.exe
  1. Click OK
  2. You are now ready to work with your Mongo Database

2. Importing a Collection


  1. In MongoDB, a Database consists of Collections. Collections consist of Documents. Documents contain data. The Schema of the database does not need to be defined.
  2. You can create Collections and Documents by inserting the data manually or by importing them.
  3. You will use the Yelp users dataset for this homework.
  4. From Blackboard, download the Zip file Yelp users.zip
  5. Unzip it to get the JSON file Yelp users.json
  6. JSON stands for JavaScript Object Notation.
  7. JSON is a syntax for storing and exchanging data. It uses an attribute and a value pair to represent data. E.g. the following is a JSON representation of a Yelp user:

“_id” : ObjectId(“58f3f82fe332b12848c97815”),

“user_id” : “PM9KEkLNoH9p4LeR49N4WQ”,

“name” : “Natalie”,

“review_count” : NumberInt(18),

“yelping_since” : “2013-04-25”,

“friends” : [

“None”

],

“useful” : NumberInt(0),

“funny” : NumberInt(0),

“cool” : NumberInt(0),

“fans” : NumberInt(1),

“elite” : [

“None”

],

“average_stars” : 3.47,

“compliment_hot” : NumberInt(0),

“compliment_more” : NumberInt(0),

“compliment_profile” : NumberInt(0),

“compliment_cute” : NumberInt(0),

“compliment_list” : NumberInt(0),

“compliment_note” : NumberInt(0),

“compliment_plain” : NumberInt(1),

“compliment_cool” : NumberInt(0),

“compliment_funny” : NumberInt(0),

“compliment_writer” : NumberInt(0),

“compliment_photos” : NumberInt(0),

“type” : “user”

  1. Explore this user or any other user on Yelp to familiarize yourself with the publicly available user data. https://www.yelp.com/user_details?userid=KUCivrQtY-iCWzb_K7oSOg
  2. To import the JSON dataset, expand your database name. Right click Collections and then choose Import Collections.
  3. Next
  4. Click on +
  5. Browse to the downloaded Yelp users.json file
  6. Check the box “Validate JSON before import”
  7. Execute
  8. After a short while, the JSON file is imported as a collection
  9. Right click the Yelp users collection and Open Collection
  10. You should now see the user data. You should explore the Result panel of your dataset to see how the user data map from the yelp website to the JSON dataset
  11. You can change the view of the data from Tree to Table to JSON (using the dropdown at the upper right of the Result panel
  1. Now you are ready to query this NoSQL database!
  2. Write query in the IntelliShell. Refer to this website for the query examples http://www.w3resource.com/mongodb-exercises/
  3. After writing the query, click on Run to see the results

YELP USERS QUERIES

Answer the following questions (Please include both screenshots and query codes):

  1. List the user names in decreasing order of average_stars.
  2. List the user name and review count of the user with the highest number of reviews
  3. Which user has yelped for the longest time?
  4. List the name of the user (and the number of friends) with the most friends

(hint: use $size to get the number of friends)

  1. Which user (name) has the most number of overall compliments?

(hint: use $add to add up all of the compliments to determine who has the most)

Fill out the Project Answer Sheet this part posted on Blackboard. Submit to Blackboard.

The post ITP 249 Part 1: MongoDB appeared first on My Assignment Online.

Plagiarism Free Assignment Help

Expert Help With This Assignment — On Your Terms

✓ Native UK, USA & Australia writers ✓ Deadline from 3 hours ✓ 100% Plagiarism-Free — Turnitin included ✓ Unlimited free revisions ✓ Free to submit — compare quotes

admin

Academic writer and editor at BestWriters.

Get your paper off your plate tonight

Post your instructions for free. Prices start at $5 per page.

Place an order