Thursday, March 1, 2018

JSON for Mongo

//books reviews
{ 
   "_id" : 1,
   "title" : "The Last Apprentice",
   "author" : "Joseph Delany",
   "ISBN" : "431423894328",
   "year" : "2012",
   "genre" : "Fantasy",
   "publisher" : "Penguin"
     
}



{
   "_id" : 2,
   "title" : "The Triple Package",
   "author" : ["Jeb Rubenfeld","Amy Chua"],
   "year" : "2014",
   "genre" : ["Non Fiction", "Sociology"],
   "publisher" : "Norton"
}

//reviews
{
   "_id" : 1,
   "booktitle" : "The Last Apprentice",
   "reviewsource" : "Good Reads",
   "reviewtitle" : "Luke warm and not skywalker",
   "reviewRating" : 3,
   "Reviewer" : {
                   "username" : "starwarsfan98",
                   "email" : "starwarsfan98@gmail.com"
                },
   "reviewdate" : "3/1/2018",
   "review" : "I liked it but I didn't like a lot."
   
}

//reviewers
{
    "_id" : 1,
    "username" : "starwarsfan98",
    "email" : "starwarsfan98@gmail.com",
    "dateregistered" : "1/2/2018",
    "reviews" :[{
                  "title" : "Luke warm and not skywalker",
                  "reviewDate" : "3/1/2018"

                 },
                 {
                    "title" : "The Darth Vader of Fantasies",
                    "reviewDate" : "3/2/2018"

                 }]
  
}

No comments:

Post a Comment