1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
var mongoose = require(‘mongoose’);
var Content = mongoose.Schema;
//表结构
var contentSchema = new Content({
title:String,
category: {
type:mongoose.Schema.Types.ObjectId,
ref:'Category'
},
description: {
type:String,
default:''
},
content: {
type:String,
default:''
}
});
module.exports = contentSchema;
|