-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdb.js
More file actions
36 lines (29 loc) · 712 Bytes
/
db.js
File metadata and controls
36 lines (29 loc) · 712 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
33
34
35
36
"use strict";
var mongoose = require('mongoose'), Mixed = mongoose.Schema.Types.Mixed;
var movieSchema = mongoose.Schema({
name: String,
yt: Mixed,
created : { type: Date, default: Date.now }
});
var playerSchema = mongoose.Schema({
name: String,
points: Number,
games: Number,
games_won: Number,
address: Mixed,
created : { type: Date, default: Date.now }
});
var gameSchema = mongoose.Schema({
state: { type: String, default: 'new' },
players: Array,
playersInfos: Array,
movies: Mixed,
correct: Mixed,
answers: Array,
created : { type: Date, default: Date.now }
});
module.exports = {
movieSchema: movieSchema,
gameSchema: gameSchema,
playerSchema: playerSchema
}