Update move-deleted-classroom-members script

This commit is contained in:
Scott Erickson 2016-04-29 13:12:22 -07:00
parent fc9974dbe1
commit 50e8000faf

View file

@ -1,7 +1,11 @@
load('bower_components/lodash/dist/lodash.js');
var classrooms = db.classrooms.find();
classrooms.forEach(function (classroom) {
print('classroom', classroom._id);
classroom.members.forEach(function (userID) {
if (_.isString(userID)) {
userID = ObjectId(userID);
}
var user = db.users.findOne({ _id: userID }, { deleted: true });
if (user.deleted) {
print('\tFOUND ONE', userID);