UNPKG

slush-mongo

Version:

A slush generator for MongoDB, which can scaffold Express/Mongojs, Express/Mongoose, Express/Mongoskin and Koa/Monk apps

17 lines (13 loc) 375 B
'use strict'; var mongoose = require('mongoose'), Schema = mongoose.Schema, ObjectId = Schema.ObjectId; var fields = { title: { type: String }, excerpt: { type: String }, content: { type: String }, active: { type: Boolean }, created: { type: Date , default: Date.now } }; var postSchema = new Schema(fields); module.exports = mongoose.model('Post', postSchema);