This repository has been archived by the owner on Jun 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
db_validation.bson
84 lines (84 loc) · 2 KB
/
db_validation.bson
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
$jsonSchema: {
bsonType: 'object',
required: [
'code',
'duration',
'teams'
],
properties: {
code: {
bsonType: 'string',
description: 'must be a string and is required'
},
duration: {
bsonType: 'int',
description: 'must be an int and is required'
},
teams: {
bsonType: 'array',
minItems: 2,
maxItems: 2,
items: {
bsonType: 'object',
required: [
'code',
'name',
'ip'
],
properties: {
code: {
bsonType: 'string',
description: 'is required and must be string'
},
name: {
bsonType: 'string',
description: 'is required and must be string'
},
numberOfPlayers: {
bsonType: 'int',
description: 'must be int'
},
constant: {
bsonType: 'double',
description: 'must be double'
},
score: {
bsonType: 'int',
description: 'must be int'
},
ip: {
bsonType: 'string',
description: 'must be string and is required'
}
}
},
description: 'must be an array (max 2 items) and is required'
},
scoreTimings: {
bsonType: 'array',
minItems: 0,
description: 'must be an array and contain a scoreTiming object',
items: {
bsonType: [
'object'
],
required: [
'time',
'team'
],
properties: {
time: {
bsonType: 'timestamp',
description: 'is required and must be timestamp'
},
teamCode: {
bsonType: 'string',
description: 'is required and must be a string'
}
}
}
}
}
}
}