Skip to content

Commit

Permalink
Update ships script for successful and attempted mr steven fairing ca…
Browse files Browse the repository at this point in the history
…tches
  • Loading branch information
jakewmeyer committed Nov 18, 2018
1 parent 51a6f28 commit 1cfa2b1
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion scripts/ships.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,28 @@ async function asyncForEach(array, callback) {
console.log(missions);

await col.updateOne({ ship_id: name }, { $set: { missions } });

if (name === 'MRSTEVEN') {
console.log('Mr Steven');
const attempted_catches = await launches.countDocuments({
upcoming: false,
launch_success: true,
'rocket.fairings.ship': 'MR STEVEN',
'rocket.fairings.recovery_attempt': true,
});
const successful_catches = await launches.countDocuments({
upcoming: false,
launch_success: true,
'rocket.fairings.ship': 'MR STEVEN',
'rocket.fairings.recovered': true,
});
console.log(`Attempts: ${attempted_catches}`);
console.log(`Successes: ${successful_catches}\n`);
await col.updateOne({ ship_id: name }, { $set: { attempted_catches, successful_catches } });
}
});
};
await start();
// await start();
await finish();
console.log(`Updated ${id.length} ships`);

Expand Down

0 comments on commit 1cfa2b1

Please sign in to comment.