-
Notifications
You must be signed in to change notification settings - Fork 0
/
hw_1.js
86 lines (74 loc) · 1.62 KB
/
hw_1.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
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
85
86
use competitions
comp1 = {
compName: 'Sofia2015',
place: 'Borisova gradina Sofia',
distanceWinner: {
'2km':'Georgi Georgiev',
'5km':'Ivan ivanov',
'10km': 'Todor Todorov'
}
}
comp2 = {
compName: 'Sofia2015',
place: 'South park Sofia',
distanceWinner: {
'2km':['Georgi Georgiev', 'Georgi Ivanov'],
'5km':'Ivan ivanov',
'10km': 'Todor Todorov'
}
}
comp3 = {
compName: 'Sofia2015',
place: 'South park Sofia',
distanceWinner: {
'2km':['Georgi Georgiev', 'Georgi Ivanov'],
'5km':'Ivan ivanov',
'10km': 'Todor Todorov'
},
duration : '3 hours'
}
comp4 = {
compName: 'Varna2014',
place: 'Borisova Varna',
distanceWinner: {
'2km':['Georgi Georgiev', 'Georgi Ivanov'],
'5km':'Ivan ivanov',
'10km': 'Todor Todorov'
}
}
comp5 = {
compName: 'Burgas2015',
place: 'North park Burgas',
distanceWinner: {
'2km':['Georgi Georgiev', 'Georgi Ivanov'],
'5km':'Ivan ivanov',
'10km': 'Todor Todorov'
}
}
db.runCompetitions.insert(comp1)
db.runCompetitions.insert(comp2)
db.runCompetitions.insert(comp3)
db.runCompetitions.insert(comp4)
db.runCompetitions.insert(comp5)
db.runCompetitions.find({place: /Sofia/}).pretty()
comp6 = {
compName: '5km Run South Park',
place: 'South Park Sofia',
distanceWinner: {
'2km':['Georgi Georgiev', 'Georgi Ivanov'],
'5km':'Ivan ivanov',
'10km': 'Todor Todorov'
}
}
db.runCompetitions.insert(comp6)
db.runCompetitions.update(
{"compName": "5km Run South Park"},
{"$set": {participants:10}}
)
// db.runCompetitions.update(
// {"compName": "Burgas2015"},
// {"$set": {
// participants: ['ivan', 'petkan']
// }
// }
// )