-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathdb.js
executable file
·38 lines (31 loc) · 914 Bytes
/
db.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var mongoose = require('mongoose')
mongoose.Promise = require('bluebird')
// mongoose.connect('mongodb://wei1:[email protected]:61018/weiwei')
mongoose.connect('mongodb://localhost:27017/weiweiblog')
var userSchema = new mongoose.Schema({
name: String,
pwd: String,
})
var articleSchema = new mongoose.Schema({
title: String,
date: Date,
articleContent: String,
state: String,
label: String,
})
var tagSchema = new mongoose.Schema({
tagName: String,
tagNumber: Number,
})
var personalInformationSchema = new mongoose.Schema({
name: String,
individualitySignature: String,
introduce: String,
})
var Models = {
User: mongoose.model('User', userSchema),
Article: mongoose.model('Article', articleSchema),
TagList: mongoose.model('TagList', tagSchema),
PersonalInformation: mongoose.model('PersonalInformation', personalInformationSchema),
}
module.exports = Models