Data Persistence Notes
###Database:
- api
###Collections:
- movies
- contacts
###Functions:
- getMovies(filter)
- getMovie(id)
- createMovie(movie)
- deleteMovie(id)
- updateMovie(movie)
- getPersons(filter)
- getPerson(id)
- createPerson(person)
- deletePerson(id)
- updatePerson(person)
###Data Bootstrap:
- Start MongoD: "mongod --dbpath 'data path'"
- If Database does not exist create. "use api"
- If Collections do not exist create. "db.persons.insert("sample_person.json");db.movies.insert("sample_movie.json");"
- Test Collections exists. "show collections"
- Mongo Dump : "mongodump --db api --out 'data path/dump_name'"
- Mongo Restore : "mongorestore 'dump path'"
###Sample Collection Members movie object
{
"description": "An exclusive golf course has to deal with a brash new member and a destructive dancing gopher.",
"datePublished": "2013-03-28T21:51:08.406Z",
"name": "Caddyshack",
"about": "An exclusive golf course has to deal with a brash new member and a destructive dancing gopher.",
"genre": "comedy",
"version": 1,
"timeRequired": "PT180M",
"contentRating": "r",
"director": "1a2356778",
"actors": "1a56258, 2abckegs, 78799abc"
}
movie meta
{
"description": "description of movie",
"datePublished": "date movie was published"
"name": "title of movie",
"about": "short description of movie",
"genre": "genre of movie",
"version": "version of this release",
"timeRequired": "time required to view this movie also known as duration",
"contentRating": "movie rating",
"director": "director of this movie",
"actors": "actors in this film"
}
person object
{
"additionalName": "mather",
"birthDate": "2013-03-28T00:00:00.000Z",
"familyName": "barnard",
"givenName": "bryan",
"gender": "male",
"deathDate": ""
}
person meta
{
"additionalName": "alternate or middle name",
"birthDate": "date of birth",
"familyName": "family name, last name in US",
"givenName": "name, first name in US",
"gender": "gender",
"deathDate": "date of death"
}
###Reference:
- [Mongo Node Driver] [1]