Monday, March 5, 2018

JSON --JavaScript Object Notation
Movie Movie Reviews
Collections Movies, Genres, Reviews, Reviewers
db.moviescollection.insert(
{
   _id : 1,
   title : "Princess Bride",
   year : "1987",
   actors :["Carry Elweys","Frank Savage","Mandy Patinkin"],
   studio : "Warner Brothers", 
   rating : "PG",
   genre : ["Fantasy", "Romance", "Comedy"]
}
)

db.reviewerscollection.insert(
{
    _id : 1,
    username : "Joe",
   email : "Joe432@gmail.com",
   dateregistered : "3/5/2018",
   reviews : [{
                movie : "Princess Bride",
                title : "The red wedding",
                reviewdate : "3/2/2018"
               },
               {
                 movie: "Shape of Water",
                 title : "fishman wins oscar",
                 reviewdate : "3/5/2018"
        }
               ]
 
}
)

db.reviewscollection.insert(
[{
   movie : "Princess Bride",
   title : "The red wedding",
   username: "Joe",
   email : "Joe432@gmail.com",
   reviewdate : "3/2/2018",
   rating : 3,
   reviewtext : "A classic romantic comedy, but a little aged"

},

{
   movie: "Shape of Water",
   title : "fishman wins oscar",
   username: "Joe",
   email : "Joe432@gmail.com",
   reviewdate : "3/5/2018",
   rating : 4.5
}]
)

No comments:

Post a Comment