Skip to content

Commit

Permalink
Fix download of concordances/mappings (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesu committed Nov 15, 2021
1 parent 47fcf0d commit 6e8ae9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion services/concordances.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion services/mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6e8ae9e

Please sign in to comment.