UNPKG

newbeely-nodejs

Version:

简单易用的轻量级nodejs服务框架. 框架简单到只有组件逻辑,不同的组件提供不同的服务,使用外部的配置文件(只有一个配置文件)方便的组合成一个完整的服务框架. 整个服务使用bearcat(网易开源的nodejs面向切面编程的轻量级框架(AOP))管理,极大的解耦组件间的耦合.(关于代码热更新后续开放).

27 lines (23 loc) 601 B
/** * @filename mongooseSchema * * @module mongooseSchema * * @author Gandalfull <orientcountry@gmail.com> * @version 1 * @time 2016-02-19 10:03 */ var Mongoose = require('mongoose'); var TableView = { name: {type: String, index: true, required: true}, age: {type: Number, default: 0}, email: {type: String, default: "xx@xx.com"} } var SchemaOption = {}; var PersonSchema = new Mongoose.Schema(TableView, SchemaOption); PersonSchema.set('redisCache', 'Person'); PersonSchema.set('expires', 3600 * 24 * 30); module.exports = { "name": "Person", "schema": PersonSchema };