You are on page 1of 8

1.

Users
The user collection will store all website users, their profiles, and movie preferences. Users will be
able to login using their username and password, and save their movie search criteria.
{
"_id":"7b7997a2-c0d2-4f8c-b27a-6a1d4b5b6310",
"hashedPassword":"$2a$08$XdvNkfdNIL8Fq7l8xsuIUeSbNOFgK0M0iV5HOskfVn7.PWncShU.O",
"profile":{
"_id":"7b7997a2-c0d2-4f8c-b27a-6a1d4b5b6310",
username: ilovemovies,
"name": "Kathy Chowaniec",
"email":"kchowani@stevens.edu"
}
preferences:{
Actor: [Melissa McCarthy, Will Ferrell],
Genre: [Comedy]
Director: [],
releaseYear: [2015, 2016],
ageRating: [PG-13, R],
keywords: []
}
}

Name

Type

Description

_id

string

A globally unique identifier to represent the user

hashedPassword

string

An encrypted string that is a hashed version of the user's


password

profile

User
Profile

The user's profile information

preferences

Preference

The users movie preferences (to save search criteria)

1a. User Profile (subdocument; not stored in a


collection)
This subdocument is used to describe the user's profile.
{
"_id":"7b7997a2-c0d2-4f8c-b27a-6a1d4b5b6310",
username: ilovemovies,
"name": "Kathy Chowaniec",
"email":"kchowani@stevens.edu"
}

Name

Type

Description

_id

string

A globally unique identifier to represent the user

username

String

A unique login identifier to represent the user

name

string

The user's full name.

email

string

A line of text that represents the user's email address.

1b. Preference (subdocument; not stored in a


collection)
This subdocument is used to describe the user's movie preferences.
Note: We may add more fields to this subdocument, as needed and as available via the API, to
support a users possible preferences.
{
Actor: [Melissa McCarthy, Will Ferrell],
Genre: [Comedy]
Director: [],
releaseYear: [2015, 2016],
ageRating: [PG-13, R],
keywords: []
}

Name

Type

Description

actor

string array

An array of actor names (can be null)

genre

string array

An array of movie genres (can be null)

director

String array

An array of director names (can be null)

releaseYear

String array

An array of movie release year dates (can be null)

ageRating

String array

An array of movie ratings for age advisory (can be null)

keywords

String array

An array of movie plot keywords (can be null)

2. Playlist
The playlist collection will store a users current movie playlist. The playlistMovies array stores a
small subset of information for each movie in the playlist, in addition to the users own review of that
movie (if provided).
{
"_id":"5a5c4461-cdc9-4144-84f9-fcb278c5c122",
"title": "Kathys Movie Marathon Playlist",
"user":{
"_id":"7b7997a2-c0d2-4f8c-b27a-6a1d4b5b6310",
username: ilovemovies,
"name": "Kathy Chowaniec",
"email":"kchowani@stevens.edu"
}
playlistMovies: [
{
_id: d7a44a10-0de3-44ad-9c58-5f3fe8f1c0d3,
movieTitle: Spy,
movieDescription: A desk-bound CIA analyst volunteers to go undercover to
infiltrate the world of a deadly arms dealer, and prevent diabolical global disaster.
,
viewed: true,
"review": {
"_id":"c5d0fd67-7977-4fc5-9088-33d0347c932b",
rating: 8.6,
date : 05/06/2016,
comment: Hysterical! I would definitely recommend this movie.

}
]
}

Name

Type

Description

_id

string

The unique identifier for the playlist

title

string

The playlist title

user

User Profile

A profile of the user whom has created the playlist

playlistMovies

playlistMovies array

An array of movies that are in the current playlist

2a. PlaylistMovies (subdocument; not stored in a


collection)
A single movie entry in the users playlist, as well as the users own review for that movie.
{
_id: d7a44a10-0de3-44ad-9c58-5f3fe8f1c0d3,
movieTitle: Spy,
movieDescription: A desk-bound CIA analyst volunteers to go undercover to
infiltrate the world of a deadly arms dealer, and prevent diabolical global disaster.
,
viewed: true,
"review": {
"_id":"c5d0fd67-7977-4fc5-9088-33d0347c932b",
rating: 8.6,
date : 05/06/2016,
comment: Hysterical! I would definitely recommend this movie.
}
}

Name

Type

Description

_id

string

The unique identifier of the movie

movieTitle

string

The movie title

movieDescription

string

A brief description of the movie

viewed

boolean

A flag to indicate if this movie was viewed by the


user

review

Review
subdocument

The users own review of the movie (can be null)

2b. Review (subdocument; not stored in a collection)


A single review by the user for a movie in the users playlist. The reviews subdocument in the
playlistMovies array only stores the review created by the user to whom the playlist belongs.

{
"_id":"c5d0fd67-7977-4fc5-9088-33d0347c932b",
rating: 8.6,
date: 05/06/2016,
comment: Hysterical! I would definitely recommend this movie.
}

Name

Type

Description

_id

string

The unique identifier for the review

rating

String

The users rating of the movie (scale of 1-5)

date

String

The date the review was posted

comment

string

The users comment about the movie

3. Movie
The movie collection will store the movies that appear in any users playlist. This is to locally store
movies that a user has in their playlist in order to reduce the number of times the movie API must be
used in retrieving movie information.
{
"_id":"d7a44a10-0de3-44ad-9c58-5f3fe8f1c0d3",
"allReviews": [
{
"_id":"c5d0fd67-7977-4fc5-9088-33d0347c932b",
"poster": {
"_id":"7b7997a2-c0d2-4f8c-b27a-6a1d4b5b6310",
username: ilovemovies,
"name": "Kathy Chowaniec",
"email":"kchowani@stevens.edu"
}
rating: 8.6,
date : 05/06/2016,
comment: Hysterical! I would definitely recommend this movie.
},
{
"_id":"e5d0fd75-8024-4fc5-1068-46g0347c762n",
"poster":{
"_id":"8c2847d5-c0f8-4f7g-b46h-3s1d4b5b6890",
username: moviebuff123,
"name":"Xiaoyong Chen",
email: xchen53@stevens.edu
},
rating: 2.4,
date : 11/23/2015,
comment: Would not watch again.
},
]
}

Name

Type

Description

_id

string

The unique identifier for the movie

allReviews

Review array

An array of all reviews posted by website users for


this movie

3a. Review (subdocument; not stored in a collection)


A single movie review by any user. The allReviews array in the Movie collection stores all reviews for
that movie.
{
"_id":"c5d0fd67-7977-4fc5-9088-33d0347c932b",
"poster":{
"_id":"7b7997a2-c0d2-4f8c-b27a-6a1d4b5b6310",
username: ilovemovies,
"name": "Kathy Chowaniec",
email: kchowani@stevens.edu,
},
rating: 4.6,m
date : 05/06/2016,
comment: Hysterical! I would definitely recommend this movie.
}

Name

Type

Description

_id

string

The unique identifier for the review

poster

User Profile

A profile of the user whom created the review

rating

string

The rating given by the reviewer (scale 1-5)

date

string

The date the review was posted

comment

string

The comment provided by the reviewer

4. Playlist History
Collection to store history of movies in a users playlist.
{
_id: 2016-11-15T21:26:17Z"
user_id: 7b7997a2-c0d2-4f8c-b27a-6a1d4b5b6310",
movie: {
_id: d7a44a10-0de3-44ad-9c58-5f3fe8f1c0d3,
"genre": [Action, Comedy, Crime],
rated: R,
keywords: [spy, cia, female spy, undercover, disaster],
"releaseDate": 06/05/2015,

user_rating: 4.6
}
}

Name

Type

Description
The timestamp of when a movie was added to a

_id

string

user_id

string

The users id

movie

Movie object

The movie added to the users playlist

users playlist

4a. Movie (subdocument; not stored in a collection)


A single movie added to a users playlst.
{
_id: d7a44a10-0de3-44ad-9c58-5f3fe8f1c0d3,
"genre": [Action, Comedy, Crime],
rated: R,
keywords: [spy, cia, female spy, undercover, disaster],
"releaseDate": 06/05/2015,
user_rating: 4.6
}

Name

Type

Description

_id

string

The unique identifier for the movie

genre

String array

An array storing the genre(s) of the movie

rated

String array

The age advisory rating given to this movie

keywords

string

An array storing the keyword(s) of the movie

releaseDate

string

The release date of the movie

user_rating

string

The rating given by the user (scale 1-5)

You might also like