Coder Social home page Coder Social logo

cyf-mongodb-queries's Introduction

Import cyf_mflix_movies_popular.json to your sample_mflix db:

  • In compass, select the sample_mflix db
  • Click '+' to create a new collection. Call it movies_popular (that way you still have the full movies collection)
  • Menu bar: Collection -> Import Data
  • Select cyf_mflix_movies_popular.json and import

Run queries in compass to find the following answers

Recap of week 1

  1. Which 3 movies came out in 1978

  2. Which 3 movies rated as PG came out in 2001

  3. Which 4 movies with a metacritic score higher than 90 came out before 1950

  4. Which 3 movies with a metacritic score higher than 90 came out in the 1990s

Deepening week 1

  1. Which 3 movies from Iran have a metacritic score higher than 80

  2. Which 4 movies from one of the Nordic Countries (Sweden, Norway, Finland, Iceland or Denmark) came out in 2011

New functionality

  1. Which 2 movies have included both Matt Damon and Julia Styles in the cast

  2. Which movie has won 210 awards?

  3. Which movie has more than 50 "rotten" reviews on rotten tomatoes, but was nominated for two Oscars

  4. What are the 3 oldest movies in the database?

  5. Which are the top 3 movies according to the number of "fresh" reviews on rotten tomatoes?

More tricky (read the documentation and figure out how to do it)

  1. What happens if I try to find the 5 movies with the lowest number of "fresh" reviews on rotten tomatoes? How can I work around that

Write express endpoints that compute and returns the answers to the following questions:

Writing simple endpoints

  1. What movies include a given actor in their cast? e.g. /filmsbyactor?actors=Tom%20Cruise

  2. What movies came out in a given year (e.g. /filmsbyyear?year=1999)

  3. What movies have a metacritic score in a range (e.g. /filmsbyscore?minscore=60&maxscore=80)

Building a search object

  1. What movies include any of the given actors (e.g. /filmsbyactor?actors=Tom%Cruise,Matt&20Damon)

  2. Write a search endpoint that optionally combines the simple endpoints (e.g. /film/search?actors=Tom%20Cruise&minscore=80 and /film/search?year=2005&maxscore=75)

More tricky

  1. What are the different kinds of "rated" categories that exist

  2. Return the titles of the movies with the top 5 metacritic scores for a given "rated" category

  3. How many movies have each of the different "rated" categories

  4. What are the worst 5 movies by ratio of fresh to rotten reviews on rotten tomatoes, and that have at least 20 fresh and rotten reviews combined

  5. Write a paginated endpoint to see all movies

  6. Write an endpoint that allows searching for keywords (a single keyword) in descriptions (and/or titles)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.