Crie uma API que use uma database com o nome mongo_aula
. Essa API deve ter endpoints que possibile as operações abaixo.
Teste os endpoints (as rotas) da API através do POSTMAN!
Insira os seguintes documentos em uma coleção de movies
.
title : Fight Club
writer : Chuck Palahniuk
year : 1999
actors : [
Brad Pitt
Edward Norton
]
title : Pulp Fiction
writer : Quentin Tarantino
year : 1994
actors : [
John Travolta
Uma Thurman
]
title : Inglorious Basterds
writer : Quentin Tarantino
year : 2009
actors : [
Brad Pitt
Diane Kruger
Eli Roth
]
title : The Hobbit: An Unexpected Journey
writer : J.R.R. Tolkein
year : 2012
franchise : The Hobbit
title : The Hobbit: The Desolation of Smaug
writer : J.R.R. Tolkein
year : 2013
franchise : The Hobbit
title : The Hobbit: The Battle of the Five Armies
writer : J.R.R. Tolkein
year : 2012
franchise : The Hobbit
synopsis : Bilbo and Company are forced to engage in a war against an array of combatants and keep the Lonely Mountain from falling into the hands of a rising darkness.
title : Pee Wee Herman's Big Adventure
title : Avatar
Realize as seguintes queries na coleção de movies
.
- Buscar todos os documentos.
- Buscar um documento apenas por _id
- Pegar todos os documentos onde
actors
inclui "Brad Pitt" - Pegar todos os documentos com
franchise
igual a "The Hobbit" - Buscar todos os filmes lançados nos anos 90s
- Buscar todos os filmes lançados entre 2000 e 2010 (incluindo 2000 e 2010)
- Pegar todos os documentos com
writer
igual a "Quentin Tarantino"
- Adicione a sinopse (synopsis) em "The Hobbit: An Unexpected Journey" : "A reluctant hobbit, Bilbo Baggins, sets out to the Lonely Mountain with a spirited group of dwarves to reclaim their mountain home - and the gold within it - from the dragon Smaug."
- Adicione a sinopse (synopsis) em "The Hobbit: The Desolation of Smaug" : "The dwarves, along with Bilbo Baggins and Gandalf the Grey, continue their quest to reclaim Erebor, their homeland, from Smaug. Bilbo Baggins is in possession of a mysterious and magical ring."
- Adicione o ator "Samuel L. Jackson" ao filme "Pulp Fiction"
- Delete o filme "Pee Wee Herman's Big Adventure"
- Delete o filme "Avatar"