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

  Explain how you would formulate an sql injection attack

Explain how you would formulate an SQL injection attack against an e-Commerce server such as Amazon

  Oracle sql complete the following steps to create a

complete the following steps to create a procedure to calculate the tax on an order. the bbtax table contains the

  Prepare a word document showing the original and final table

Consider a typical sales invoice that would include the following information. Design a single table to hold all of the information required to store an invoice including this information. Next, apply normalization to reduce this table to third no..

  Describe the main capabilities of mysql

describe the main capabilities of MySQL.

  Design a high-level conceptual view of a data warehouse by

an organization has several operational systems customer relationship management crm for marketing and sales enterprise

  Methods that can be used to optimize database components

Evaluate at least two methods that can be used to optimize database components such as queries, reports SQL transaction processing, and data consumption

  Draw a complete eerd by using entities and attributes

Draw a complete EERD by using entities and attributes that have been identified above. Make sure you clearly identify the relationships between the entities and their cardinality.

  Define the database environment chosen

The following assignment is based on the database environment chosen and discussed in the Week Two Individual Assignment. Use a Microsoft Visio diagram to create a detailed ERD using the data specificationsnoted in the Week Two Individual Assignmen..

  Discuss iterative design as it relates to databases overall

Discuss iterative design as it relates to databases overall. Determine whether one must design a database iteratively or design the entire database all at once. Provide a rationale for your answer

  Create mock-up report to make the monthly claim

He wishes you to group data by insurance company number, with subtotals by company and grand totals for each numeric field.

  Evaluate use of a distributed dbms structure is appropriate

Evaluate whether the use of a distributed DBMS structure is appropriate and identify the optimization techniques that should be factored in to enhance the operations of the database in your design.

  Why is a documentation plan important

What are the key components of change theory and how can they be put into practice?

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