Question: Used MongoDB. Write a script command that will list the Rentals. ( db.getCollection('nameOfDatabase').find({}) ) Include all rental information. Update the Rentals to show a return

Used MongoDB. Write a script command that will list the Rentals. ( db.getCollection('nameOfDatabase').find({}) ) Include all rental information.

Update the Rentals to show a return valid date on each rental.

Write a script that will only show each users' names and the movie titles they have rented.

/* 1 */ { "_id" : 1000, "firstName" : "John", "lastName" : "Turner", "phoneNumber" : [ "8085551212", "8015550055" ], "userType" : "A", "customerType" : "P", "banStatus" : "N", "Questions" : [ { "Question" : "What was the name of the first school that you attended", "Answer" : "Ponderosa Elementary" }, { "Question" : "What was the name of your favorite pet", "Answer" : "Domino" }, { "Question" : "What was your mother's maiden name", "Answer" : "Stokes" } ], "MovieID" : "TrGrt", "Title" : "True Grit", "copyNumber" : "1", "movieType" : "B", "rentalDate" : ISODate("2017-03-02T07:00:00.000Z"), "Actors" : [ { "ActorFirstName" : "John", "ActorLastName" : "Wayne" }, { "ActorFirstName" : "Glen", "ActorLastName" : "Campbell" } ], "Director" : [ { "DirectorFirstName" : "Henry", "DirectorLastName" : "Hathaway" } ], "Keywords" : "Western, Academy Award, Horses, Rooster Cogburn", "genre" : "Western", "genreDescription" : "A genre of various arts which tell stories set primarily in the later half of the 19th century in the American Old West, often centering on the life of a nomadic cowboy or gunfighter armed with a revolver and a rifle who rides a horse. Cowboys and gunslingers typically wear Stetson hats, bandannas, spurs, cowboy boots and buckskins. Other characters include Native Americans, bandits, lawmen, bounty hunters, outlaws, soldiers (especially mounted cavalry), settlers and townsfolk." }

/* 2 */ { "_id" : 1001, "firstName" : "John", "lastName" : "Turner", "phoneNumber" : [ "8085551212", "8015550055" ], "userType" : "A", "customerType" : "P", "banStatus" : "N", "Questions" : [ { "Question" : "What was the name of the first school that you attended", "Answer" : "Ponderosa Elementary" }, { "Question" : "What was the name of your favorite pet", "Answer" : "Domino" }, { "Question" : "What was your mother's maiden name", "Answer" : "Stokes" } ], "MovieID" : "TrGrt", "Title" : "True Grit", "copyNumber" : "2", "movieType" : "D", "rentalDate" : ISODate("2017-04-05T07:00:00.000Z"), "Actors" : [ { "ActorFirstName" : "John", "ActorLastName" : "Wayne" }, { "ActorFirstName" : "Glen", "ActorLastName" : "Campbell" } ], "Director" : [ { "DirectorFirstName" : "Henry", "DirectorLastName" : "Hathaway" } ], "Keywords" : "Western, Academy Award, Horses, Rooster Cogburn", "genre" : "Western", "genreDescription" : "A genre of various arts which tell stories set primarily in the later half of the 19th century in the American Old West, often centering on the life of a nomadic cowboy or gunfighter armed with a revolver and a rifle who rides a horse. Cowboys and gunslingers typically wear Stetson hats, bandannas, spurs, cowboy boots and buckskins. Other characters include Native Americans, bandits, lawmen, bounty hunters, outlaws, soldiers (especially mounted cavalry), settlers and townsfolk." }

/* 3 */ { "_id" : 1002, "firstName" : "John", "lastName" : "Turner", "phoneNumber" : [ "8085551212", "8015550055" ], "userType" : "A", "customerType" : "P", "banStatus" : "N", "Questions" : [ { "Question" : "What was the name of the first school that you attended", "Answer" : "Ponderosa Elementary" }, { "Question" : "What was the name of your favorite pet", "Answer" : "Domino" }, { "Question" : "What was your mother's maiden name", "Answer" : "Stokes" } ], "MovieID" : "StrWrs", "Title" : "Star Wars", "copyNumber" : "1", "movieType" : "D", "rentalDate" : ISODate("2017-03-10T07:00:00.000Z"), "Actors" : [ { "ActorFirstName" : "Harrison", "ActorLastName" : "Ford" }, { "ActorFirstName" : "Cari", "ActorLastName" : "Fisher" } ], "Director" : [ { "DirectorFirstName" : "George", "DirectorLastName" : "Lucas" } ], "Keywords" : "Space, Adventure, Jedi", "genre" : "Action", "genreDescription" : "Action fiction is the literary genre that includes spy novels, adventure stories, tales of terror and intrigue cloak and dagger , and mysteries. This kind of story utilizes suspense, the tension that is built up when the reader wishes to know how the conflict between the protagonist and antagonist is going to be resolved or what the solution to the puzzle of a thriller is." }

/* 4 */ { "_id" : 1003, "firstName" : "Drew", "lastName" : "Weidman", "phoneNumber" : [ "8016267025", "8016266000" ], "userType" : "S", "customerType" : "P", "banStatus" : "N", "Questions" : [ { "Question" : "What was the name of the first school that you attended", "Answer" : "North Park" }, { "Question" : "What was the name of your favorite pet", "Answer" : "Bear" }, { "Question" : "What was your mother's maiden name", "Answer" : "Wise" } ], "MovieID" : "ShwRdmptn", "Title" : "Shawshank Redemption", "copyNumber" : "2", "movieType" : "D", "rentalDate" : ISODate("2017-04-28T07:00:00.000Z"), "Actors" : [ { "ActorFirstName" : "Time", "ActorLastName" : "Robbins" }, { "ActorFirstName" : "Morgan", "ActorLastName" : "Freeman" } ], "Director" : [ { "DirectorFirstName" : "Frank", "DirectorLastName" : "Darabont" } ], "Keywords" : "prison, escape, corruption", "genre" : "Drama", "genreDescription" : "These terms tend to indicate a particular setting or subject-matter, or else they qualify the otherwise serious tone of a drama with elements that encourage a broader range of moods." }

/* 5 */ { "_id" : 1004, "firstName" : "Drew", "lastName" : "Weidman", "phoneNumber" : [ "8016267025", "8016266000" ], "userType" : "S", "customerType" : "P", "banStatus" : "N", "Questions" : [ { "Question" : "What was the name of the first school that you attended", "Answer" : "North Park" }, { "Question" : "What was the name of your favorite pet", "Answer" : "Bear" }, { "Question" : "What was your mother's maiden name", "Answer" : "Wise" } ], "MovieID" : "GrdnsGlxy", "Title" : "Guardians of the Galaxy", "copyNumber" : "1", "movieType" : "B", "rentalDate" : ISODate("2017-05-10T07:00:00.000Z"), "Actors" : [ { "ActorFirstName" : "Chris", "ActorLastName" : "Pratt" }, { "ActorFirstName" : "Bradley", "ActorLastName" : "Cooper" } ], "Director" : [ { "DirectorFirstName" : "James", "DirectorLastName" : "Gunn" } ], "Keywords" : "bounty hunter, outer space, tree", "genre" : "Action", "genreDescription" : "Action fiction is the literary genre that includes spy novels, adventure stories, tales of terror and intrigue cloak and dagger, and mysteries. This kind of story utilizes suspense, the tension that is built up when the reader wishes to know how the conflict between the protagonist and antagonist is going to be resolved or what the solution to the puzzle of a thriller is." }

/* 6 */ { "_id" : 1005, "firstName" : "Drew", "lastName" : "Weidman", "phoneNumber" : [ "8016267025", "8016266000" ], "userType" : "S", "customerType" : "P", "banStatus" : "N", "Questions" : [ { "Question" : "What was the name of the first school that you attended", "Answer" : "North Park" }, { "Question" : "What was the name of your favorite pet", "Answer" : "Bear" }, { "Question" : "What was your mother's maiden name", "Answer" : "Wise" } ], "MovieID" : "ShwRdmptn", "Title" : "Shawshank Redemption", "copyNumber" : "2", "movieType" : "D", "rentalDate" : ISODate("2017-06-14T07:00:00.000Z"), "Actors" : [ { "ActorFirstName" : "Time", "ActorLastName" : "Robbins" }, { "ActorFirstName" : "Morgan", "ActorLastName" : "Freeman" } ], "Director" : [ { "DirectorFirstName" : "Frank", "DirectorLastName" : "Darabont" } ], "Keywords" : "prison, escape, corruption", "genre" : "Drama", "genreDescription" : "These terms tend to indicate a particular setting or subject-matter, or else they qualify the otherwise serious tone of a drama with elements that encourage a broader range of moods." }

/* 7 */ { "_id" : 1006, "firstName" : "Joe", "lastName" : "Smith", "phoneNumber" : [ "8011352353", "8016753623" ], "userType" : "S", "customerType" : "S", "banStatus" : "N", "Questions" : [ { "Question" : "What was the name of the first school that you attended", "Answer" : "McKiinley" }, { "Question" : "What was the name of your favorite pet", "Answer" : "Max" }, { "Question" : "What was your mother's maiden name", "Answer" : "Smith" } ], "MovieID" : "BlzngSddls", "Title" : "Blazing Saddles", "copyNumber" : "3", "movieType" : "B", "rentalDate" : ISODate("2017-10-15T07:00:00.000Z"), "Actors" : [ { "ActorFirstName" : "Gene", "ActorLastName" : "Wilder" }, { "ActorFirstName" : "Cleavon", "ActorLastName" : "Little" } ], "Director" : [ { "DirectorFirstName" : "Mel", "DirectorLastName" : "Brooks" } ], "Keywords" : "Western, Comedy, corrupt politician, Sheriff", "genre" : "Comedy", "genreDescription" : "Main emphasis is humour, designed to make the audience laugh through amusement by exaggerating characteristics or situations" }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!