diff --git a/migrations/1496771633_tags.js b/migrations/1496771633_tags.js index a7155e2d1..6893a5c47 100644 --- a/migrations/1496771633_tags.js +++ b/migrations/1496771633_tags.js @@ -53,22 +53,25 @@ const transformTags = ({ id, tags }) => ({ module.exports = { async up({ transformSingleWithCursor }) { // Find all comments that have tags. - const cursor = CommentModel.collection.aggregate([ - { - $match: { - tags: { - $exists: true, - $ne: [], + const cursor = CommentModel.collection.aggregate( + [ + { + $match: { + tags: { + $exists: true, + $ne: [], + }, }, }, - }, - { - $project: { - id: true, - tags: true, + { + $project: { + id: true, + tags: true, + }, }, - }, - ]); + ], + { allowDiskUse: true } + ); await transformSingleWithCursor(cursor, transformTags, CommentModel); }, diff --git a/services/migration/helpers.js b/services/migration/helpers.js index f2d959ca4..5eb33aadf 100644 --- a/services/migration/helpers.js +++ b/services/migration/helpers.js @@ -23,7 +23,7 @@ const debugProcessStatistics = (count, totalCount) => { debug( `processed ${(count / totalCount * 100).toFixed( 2 - )}% (${count}/${totalCount}) update` + )}% (${count}/${totalCount}) updates` ); } else { debug(`processed ${count} updates`);