-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdataaccess.js
More file actions
72 lines (67 loc) · 1.38 KB
/
Copy pathdataaccess.js
File metadata and controls
72 lines (67 loc) · 1.38 KB
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
const workoutmodel = require('./models/workout');
const exmodel = require('./models/exercise');
/*
let ex =
[
{
type: "Abs",
name: "Crunch"
},
{
type: "Abs",
name: "Leg Raises"
},
{
type: "Abs",
name: "Machine Rotation"
},
{
type: "Back",
name: "Chin-up"
},
{
type: "Back",
name: "Face Pull"
},
{
type: "Back",
name: "Cable Row"
}
]
ex.forEach(e => {
let mod = new exmodel();
mod.type = e.type;
mod.name = e.name;
mod.save((err) => {
console.log(err);
})
});
*/
let wo = [
{
name: 'Push Day',
start_time: '2012-01-26 10:00:00',
finish_time: '2012-01-26 12:00:00',
weight: 95.1,
notes: 'LIGHTWEIGHT BABY',
},
{
name: 'Pull Day',
start_time: '2012-01-26 12:00:00',
finish_time: '2012-01-26 12:00:00',
weight: 95.1,
notes: 'AIN\'t nuttin with a peanut',
}
];
wo.forEach(w => {
let mod = new workoutmodel();
mod.name = w.name;
mod.start_time = w.start_time;
mod.finish_time = w.finish_time;
mod.weight = w.weight;
mod.notes = w.notes;
mod.exercises = [];
mod.save((err) => {
console.log(err);
})
});