-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollections.js
58 lines (55 loc) · 1.14 KB
/
collections.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Messages = new Mongo.Collection("messages");
Chatrooms = new Mongo.Collection("chatrooms");
// set up a schema controlling the allowable
// structure of Chatroom objects
Chatrooms.attachSchema(new SimpleSchema({
title: {
type: String,
label: "Title",
max: 200
},
description: {
type: String,
label: "Description",
max: 1000
},
createdBy: {
type: String,
autoform: {
type: "hidden",
label: false
},
defaultValue: 'anon'
},
}));
Messages.attachSchema(new SimpleSchema({
messageText: {
type: String,
label: "Message",
max: 200
},
nickname: {
type: String,
autoform: {
type: "hidden",
label: false
},
defaultValue: '0'
},
createdOn: {
type: Date,
autoform: {
type: "hidden",
label: false
},
defaultValue: new Date(),
},
chatroomId: {
type: String,
autoform: {
type: "hidden",
label: false
},
defaultValue: '0'
},
}));