Do not collect camper data of private campers
This commit is contained in:
@ -18,7 +18,8 @@ MongoClient.connect(secrets.db, function(err, database) {
|
|||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
var stream = database.collection('user')
|
var stream = database.collection('user')
|
||||||
.find({'completedChallenges': { $ne: null }},
|
.find({'completedChallenges': { $ne: null },
|
||||||
|
'isLocked': { $ne: true } },
|
||||||
{'completedChallenges': true})
|
{'completedChallenges': true})
|
||||||
.stream();
|
.stream();
|
||||||
console.log('[');
|
console.log('[');
|
||||||
@ -26,16 +27,16 @@ MongoClient.connect(secrets.db, function(err, database) {
|
|||||||
if (!results.completedChallenges) {
|
if (!results.completedChallenges) {
|
||||||
// dud
|
// dud
|
||||||
} else {
|
} else {
|
||||||
var testout = [];
|
var dataOut = [];
|
||||||
results.completedChallenges.forEach(function(challenge) {
|
results.completedChallenges.forEach(function(challenge) {
|
||||||
testout.push({
|
dataOut.push({
|
||||||
name: challenge.name,
|
name: challenge.name,
|
||||||
completedDate: challenge.completedDate,
|
completedDate: challenge.completedDate,
|
||||||
solution: challenge.solution
|
solution: challenge.solution
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
if (testout.length) {
|
if (dataOut.length) {
|
||||||
console.log(JSON.stringify(testout) + ',');
|
console.log(JSON.stringify(dataOut) + ',');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).on('end', function() {
|
}).on('end', function() {
|
||||||
|
Reference in New Issue
Block a user