Question 71

Suppose you have a restaurants collection with the following document structure: { _id: ObjectId("5eb3d668b31de5d588f42931"), address: { building: '6409', coord: [ -74.00528899999999, 40.628886 ], street: '11 Avenue', zipcode: '11219' }, borough: 'Brooklyn', cuisine: 'American', grades: [ { date: ISODate("2014-07-18T00:00:00.000Z"), grade: 'A', score: 12 }, { date: ISODate("2013-07-30T00:00:00.000Z"), grade: 'A', score: 12 }, { date: ISODate("2013-02-13T00:00:00.000Z"), grade: 'A', score: 11 }, { date: ISODate("2012-08-16T00:00:00.000Z"), grade: 'A', score: 2 }, { date: ISODate("2011-08-17T00:00:00.000Z"), grade: 'A', score: 11 } ], name: 'Regina Caterers', restaurant_id: '40356649' } You have the following index: { "cuisine": 1, "borough": 1 } What will the query plan look like for the following query?
db.restaurants.find( { "cuisine": "American", "borough": { "$gt": "S" } } )
  • Question 72

    Which of the following statements are true about the mongo shell? Check all that apply.
  • Question 73

    How can we represent a one-to-one relationship in MongoDB?
  • Question 74

    Why adding indexes may lead to slower write operations?
  • Question 75

    We have a movies collection with the following document structure: { _id: ObjectId("573a1390f29313caabcd6223"), genres: [ 'Comedy', 'Drama', 'Family' ], title: 'The Poor Little Rich Girl', released: ISODate("1917-03-05T00:00:00.000Z"), year: 1917, imdb: { rating: 6.9, votes: 884, id: 8443 } } We need to extract all 'Crime' movies from this collection. Which query should we use? Check all that apply.