DSCI 551 – MongoDB Lab 20 points (note this lab worth twice as much as previous labs) Due: 4/2/2021, Friday You are provide with two JSON files (generated from homework 1): chats.json and roster.json. The files need to be transformed into format suitable for importing into MongoDB. (see restaurant data set in the lecture for detailed format). Import the data into your MongoDB database. Write a MongoDB operation (find, aggregate, etc) for each of the following questions: Submit a document that contains the screenshots of both the operations and their results. 1. Find out the number of people who made at least one chat. 2. Find out the names of students (from roster) whose name contains "li" (case insensitive). Output only the names in the ascending order. 3. Find out the names of top-5 persons ranked by the number of chats (descending order) they have made, return both the name and the number of chats. 4. Find out the names of persons who did not make any chats. Return names only, sorted by name(ascending order). 5. Add a new student John Smith, participated from "United States of America" to the roster, with age = 25. 6. Add a new student Mary Smith with age = 30 (no need to add participation info). 7. Change the name of student John Smith to Jonny Smith and age to 36. 8. Add a new attribute Program and set its value to "ADS" for all students whose names contain Smith (case insensitive).
欢迎咨询51作业君