falsepositives migration (5rd round)

This commit is contained in:
Vicente J. Ruiz Jurado 2018-03-26 17:55:43 +02:00
parent d538f8cd8e
commit 21531d1fd2

View file

@ -213,11 +213,15 @@ Meteor.startup(() => {
version: 16,
up: function moveToFalsePositivesUppercaseWithUser() {
const falsepositiveslower = new Mongo.Collection('falsepositives', { idGeneration: 'MONGO' });
const now = new Date();
falsepositiveslower.find({}).forEach((falseDoc) => {
const user = Meteor.users.findOne({ telegramChatId: falseDoc.chatId });
if (user) {
falseDoc.owner= user._id;
}
falseDoc.type = 'industry';
falseDoc.createdAt = now;
falseDoc.updatedAt = now;
FalsePositives.insert(falseDoc);
});
}