-
-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathcontest.js
52 lines (50 loc) · 1.03 KB
/
contest.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
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const rankingSchema = new Schema({
_id: String,
user_slug: String,
country_code: String,
country_name: String,
data_region: {
type: String,
default: "US",
},
rank: Number,
current_rating: {
type: Number,
default: null,
},
delta: {
type: Number,
default: null,
},
});
const ContestRankingsSchema = new Schema({
_id: String,
title: String,
startTime: Date,
endTime: Date,
contest_id: Number,
user_num: Number,
rankings_fetched: {
type: Boolean,
default: false,
},
users_fetched: {
type: Boolean,
default: false,
},
ratings_predicted: {
type: Boolean,
default: false,
},
rankings: [rankingSchema],
refetch_rankings:{
type:Boolean,
default:false,
},
lastUpdated: {
type: Date,
},
});
module.exports = mongoose.model("Contest", ContestRankingsSchema);