Skip to content

Commit

Permalink
Merge branch 'feature/purge-pins'
Browse files Browse the repository at this point in the history
  • Loading branch information
GuyHarwood committed Nov 28, 2017
2 parents fd7318c + 2962a6b commit f0f24a8
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions deploy/jobs/purge-pins.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
'use strict'

try {
db.pupils.updateMany(
{ pin: {$ne: null} },
{ $set: { pin: null, pinExpiresAt: null } }
);
db.schools.updateMany(
print('erasing pupil pins...')
printjson(db.pupils.updateMany(
{ pin: {$ne: null} },
{ $set: { pin: null, pinExpiresAt: null } }
))

print('erasing school pins...')
printjson(db.schools.updateMany(
{ schoolPin: {$ne: null} },
{ $set: { schoolPin: null, pinExpiresAt: null } }
);
))
} catch (e) {
print(e);
}
print('ERROR...')
print(e)
throw e
}

0 comments on commit f0f24a8

Please sign in to comment.