Delete movies collection using aggregation pipeline approach

Assignment Help Database Management System
Reference no: EM13999189

You need to have hollywood database with actors collection (see mongodb.txt).

1.

Add attribute gender: male/female to each document in the actors collection (if it doesn't exist) Add at least 5 more actors (each with at least 3 movies) to the actors collection from Lab3.

2.

If you run db.movies.find() you should see something like:

{ "_id" : { "movie" : "Chicago" }, "value" : { "actors" : [ "Richard Gere III" ] } }

{ "_id" : { "movie" : "Osage County" }, "value" : { "actors" : [ "Meryl Streep", "Julia Roberts" ] } }

{ "_id" : { "movie" : "Pretty Woman" }, "value" : { "actors" : [ "Julia Roberts", "Richard Gere III" ] } }

{ "_id" : { "movie" : "Runaway Bride" }, "value" : { "actors" : [ "Julia Roberts", "Richard Gere III" ] } }

{ "_id" : { "movie" : "The Devil Wears Prada" }, "value" : { "actors" : [ "Meryl Streep" ] } }

{ "_id" : { "movie" : "The Iron Lady" }, "value" : { "actors" : [ "Meryl Streep" ] } }

Using map/reduce and post-processing please show how to create movies collection that has documents with only female actors in the following form:

{ "_id" : { "movie" : "Osage County" }, "actors" : [ "Meryl Streep", "Julia Roberts" ] }

{ "_id" : { "movie" : "Pretty Woman" }, "actors" : [ "Julia Roberts"] }

Note: You need to find the most optimal way to do this.

3.

Delete movies collection and re-create it using the aggregation pipeline approach. The documents in the movies collection must be in the modified form shown in Q2. Just like in Q2, only female actors must be listed.

Add the following to the aggregation pipeline:

- Actors must be listed sorted in ascending order

What to submit:

1. db.actors.insert(....) statements for at least 5 actors.

2. Your map/reduce functions.

3. You must provide the MongoDB aggregation statements that you used to produce the movies collection. Also, you need to submit collections from hollywood database in JSON format (files actors.json and movies.json):

mongoexport --db hollywood --collection=actors --type=json --out actors.json

mongoexport --db hollywood --collection=movies --type=json --out movies.json

Attachment:- mongodb.txt

Reference no: EM13999189

Questions Cloud

What is the specific citation from the fasb : Describe to Alice the necessary disclosure requirements for the obligation. What is the specific citation from the FASB's Codification Research System that contains these disclosure requirements?
The enzyme responsible for decarboxylation : The enzyme responsible for decarboxylation of branched chain amino acids is?
Autosomal recessive homogentisic acid oxidase : Autosomal recessive homogentisic acid oxidase deficiency results in
The unbound or free hormones that are : It is generally accepted that it is the unbound or free hormones that are?
Delete movies collection using aggregation pipeline approach : Delete movies collection and re-create it using the aggregation pipeline approach - Add attribute gender: male/female to each document in the actors collection
Find the change in the cars kinetic energy from the bottom : Energy Pretest A 1300-kg car drives up a hill that is 17.0 m high. Find the change in the car's kinetic energy from the bottom of the hill to the top of the hill.
Find the impedances of the approximate equivalent circuit : Find the impedances of the approximate equivalent circuit referred to the primary side, and referred to the secondary side and sketch that circuit - find the power factor of the Open-circuit test and the power factor of the Short-circuit test.
Describe your strongest style and your weakest style : Describe your strongest style(s) and your weakest style. Provide examples to illustrate how the strong styles characterize you (or, in the case of your weakest style, do not characterize you)
How might you benefit from changing your self-concept : What do you remember being told as a child that still influences your behavior today in a negative way? In a positive way? How might you benefit from changing your self-concept

Reviews

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd