Skip to content

Commit 1cfa2b1

Browse files
committed
Update ships script for successful and attempted mr steven fairing catches
1 parent 51a6f28 commit 1cfa2b1

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

scripts/ships.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,28 @@ async function asyncForEach(array, callback) {
111111
console.log(missions);
112112

113113
await col.updateOne({ ship_id: name }, { $set: { missions } });
114+
115+
if (name === 'MRSTEVEN') {
116+
console.log('Mr Steven');
117+
const attempted_catches = await launches.countDocuments({
118+
upcoming: false,
119+
launch_success: true,
120+
'rocket.fairings.ship': 'MR STEVEN',
121+
'rocket.fairings.recovery_attempt': true,
122+
});
123+
const successful_catches = await launches.countDocuments({
124+
upcoming: false,
125+
launch_success: true,
126+
'rocket.fairings.ship': 'MR STEVEN',
127+
'rocket.fairings.recovered': true,
128+
});
129+
console.log(`Attempts: ${attempted_catches}`);
130+
console.log(`Successes: ${successful_catches}\n`);
131+
await col.updateOne({ ship_id: name }, { $set: { attempted_catches, successful_catches } });
132+
}
114133
});
115134
};
116-
await start();
135+
// await start();
117136
await finish();
118137
console.log(`Updated ${id.length} ships`);
119138

0 commit comments

Comments
 (0)