摘要:
Models是从 Schema 定义编译的构造函数。这些 model 的实例代表能从数据库存储和检索的 documents。数据库中所有document的创建和检索都是这些model处理的。 1、编译第一个model var schema = new mongoose.Schema({ name: 阅读全文
摘要:
1、定义shcema 在mongoose里一切都由schema开始。每一个schema对应一个mongoDB collection 并且在那个collection里面定义了documents的模型。 var mongoose = require('mongoose'); var Schema = m 阅读全文