Skip to content

Instantly share code, notes, and snippets.

@shivasurya
Created August 28, 2014 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shivasurya/f99230c47b672c0d2ccf to your computer and use it in GitHub Desktop.
Save shivasurya/f99230c47b672c0d2ccf to your computer and use it in GitHub Desktop.
Simple Schema for mongoose DB
var mongoose = require('mongoose');
var movie_api = mongoose.Schema({
movie : {
name : String,
year : String,
director : String,
genre : String,
thumb : String ,
music : String,
rating : Number ,
}
});
//you can have methods here
module.exports = mongoose.model('movie', movie_api);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment