-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathschema.coffee
56 lines (48 loc) · 1.21 KB
/
schema.coffee
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
module.exports = (mongoose)->
class Schema
constructor: (mongoose)->
Schema = mongoose.Schema
ObjectId = Schema.ObjectId
UserSchema = new Schema
username : String
password : String
acive : Boolean
created : Date
CategorySchema = new Schema
permaLink : String
title : String
CommentSchema = new Schema
title : String
text : String
date : Date
PostSchema = new Schema
id : ObjectId
author : String
title : String
permaLink : String
body : String
date : Date
categories : [String]
comments : [CommentSchema]
publish : Boolean
BlogSchema = new Schema
url : String
title : String
updated : Date
MapSchema = new Schema
id : ObjectId
permaLink : String
content : String
MediaSchema = new Schema
id : ObjectId
title : String
url : String
type : String
date : Date
mongoose.model 'user', UserSchema
mongoose.model 'blog', BlogSchema
mongoose.model 'category', CategorySchema
mongoose.model 'post', PostSchema
mongoose.model 'map', MapSchema
mongoose.model 'media', MediaSchema
new Schema(mongoose)