From 6e8ae9e8ae35efe1db6239ff1fa80cb6d55f2648 Mon Sep 17 00:00:00 2001 From: Stefan Peters Date: Mon, 15 Nov 2021 12:15:53 +0100 Subject: [PATCH] Fix download of concordances/mappings (#150) --- services/concordances.js | 2 +- services/mappings.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/concordances.js b/services/concordances.js index 191cfd6..6da6bbb 100644 --- a/services/concordances.js +++ b/services/concordances.js @@ -57,7 +57,7 @@ module.exports = class ConcordanceService { if (query.download) { // For a download, return a stream - return Concordance.find(mongoQuery).lean().stream() + return Concordance.find(mongoQuery).lean().cursor() } else { // Otherwise, return results const concordances = await Concordance.find(mongoQuery).lean().skip(query.offset).limit(query.limit).exec() diff --git a/services/mappings.js b/services/mappings.js index f2c39c9..4e3a0c2 100644 --- a/services/mappings.js +++ b/services/mappings.js @@ -274,7 +274,7 @@ module.exports = class MappingService { if (download) { // For a download, return a stream - return model.aggregate(pipeline).cursor().exec() + return model.aggregate(pipeline).cursor() } else { // Otherwise, return results const mappings = await model.aggregate(pipeline).sort(sorting).skip(offset).limit(limit).exec()