Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DBMS Expert


Home >> DBMS

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

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M91708013
  • Price:- $35

Guranteed 24 Hours Delivery, In Price:- $35

Have any Question?


Related Questions in DBMS

Question create an erd for the following scenario once you

Question: Create an ERD for the following scenario. Once you submit you will get access to the correct way to create the ERD. Please watch the video and correct any errors in your submission and resubmit. A small company ...

Answer the following question explain the difference

Answer the following Question : Explain the difference between a database management system (DBMS) and a database. Are Microsoft Access, SQL Server, and Oracle examples of databases or database management systems (DBMS)?

Questionsuppose a prolog database exists that gives

Question: Suppose a Prolog database exists that gives information about states and capital cities. Some cities are big, others small. Some states are eastern, others are western. a. Write a query to find all the small ca ...

Select from e d pwhere edeptddept and dcitypcity and

Select * From E, D, P WHERE E.dept=D.dept AND D.city=P.city AND D.budget>1M AND P.priority=A; Assuming relations have the same size and uniform distributions, what is the best plan with Nested Loop joins only? Write it a ...

Stored procedure please create the following stored

Stored procedure. Please create the following stored routines using CPS3740_2017S database using the tables in dreamhome database. xxxx is your email id 1) Implement a stored procedure p3Q21_xxxx to display the Branch ci ...

You can work on this assignment individually or in a group

You can work on this assignment individually or in a group of 2. If you are working in a group please establish a group in Assignment 2 Group on Canvas In this assignment you are asked to explore the use of neural networ ...

Assignmenta restaurant is designing a database to keep

Assignment A restaurant is designing a database to keep track of customer services. A customer is defined as a customer ID, name, address and a telephone number. Customers are served by employees. Each employee is define ...

Tableau is business intelligence software that helps people

Tableau is business intelligence software that helps people see and understand their data. Fast Analytics Connect and visualize your data in minutes. Tableau is 10 to 100x faster than existing solutions. Ease of Use Anyo ...

Question 1 describe 1nf 2nf 3nf2 explain why 4nf is a

Question: 1: Describe 1NF, 2NF, 3NF. 2: Explain why 4NF is a normal form more desirable than BCNF. The response must be typed, single spaced, must be in times new roman font (size 12) and must follow the APA format.

Suppose that we have a table of house prices and a table of

Suppose that we have a table of house prices and a table of zip codes: • hprices(hid (PK),address,bedrooms,price,zipcode) • zipcodes(zipcode (PK),state) Write a SQL query that finds the average, maximum, and minimum pric ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As