Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
example mongoose model
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
var fields = {
// fields for model
name: String
var ModelSchema = new Schema(fields);
module.exports = mongoose.model('ModelName', ModelSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment