Skip to main content

Exercise 5

  • Start MongoDB server
  • Connect to MongoDB server using MongoDB shell and
  • Select comics database
  • Drop the superheroes collection
  • Drop the comics database
  • Re-create the comic database and superheroes collection
  • Insert the following documents
{ "name": "SPIDER-MAN", "image": "spiderman.jpg" }
{ "name": "CAPTAIN MARVEL", "image": "captainmarvel.jpg" }
{ "name": "HULK", "image": "hulk.jpg" }
{ "name": "THOR", "image": "thor.jpg" }
{ "name": "IRON MAN", "image": "ironman.jpg" }
{ "name": "DAREDEVIL", "image": "daredevil.jpg" }
{ "name": "BLACK WIDOW", "image": "blackwidow.jpg" }
{ "name": "CAPTAIN AMERICA", "image": "captanamerica.jpg" }
{ "name": "WOLVERINE", "image": "wolverine.jpg" }
{ "name": "BLACK PANTHER", "image": "blackpanther.jpg" }
{ "name": "SUPERMAN", "image": "superman.jpg" }
{ "name": "BATMAN", "image": "batman.jpg" }
  • Query the documents with the BATMAN name
  • Query the documents with the HULK name