-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.js
More file actions
32 lines (27 loc) · 702 Bytes
/
models.js
File metadata and controls
32 lines (27 loc) · 702 Bytes
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
var mongoose = require("mongoose");
var UserSchema = new mongoose.Schema({
username: String,
password: String,
email: String,
phoneNumber: Number,
reminderTime: Number,
reminderInterval: Number
});
var SessionSchema = new mongoose.Schema({
cookieIDStr: String,
userId: String
});
var ThoughtSchema = new mongoose.Schema({
content: String,
createdAt: {
type: Date,
default: Date.now
},
userId: mongoose.Schema.ObjectId
});
var Thoughts = mongoose.model('Thought', ThoughtSchema);
var Users = mongoose.model('User', UserSchema);
var Sessions = mongoose.model('Session', SessionSchema);
exports.Thoughts = Thoughts;
exports.Users = Users;
exports.Sessions = Sessions;