Archived
2

small fixes

This commit is contained in:
VLE2FE
2020-08-20 10:42:55 +02:00
parent e8529c2b23
commit 092c547fff
3 changed files with 296 additions and 117 deletions

View File

@ -262,7 +262,9 @@ router.get('/samples', async (req, res, next) => {
// count total number of items before $skip and $limit, only works when from-id is not specified and spectra are not
// included
if (!filters.fields.find(e => e.indexOf(globals.spectrum.spectrum + '.') >= 0) && !filters['from-id']) {
if (!filters.fields.find(e =>
e.indexOf(globals.spectrum.spectrum + '.' + globals.spectrum.dpt) >= 0) && !filters['from-id']
) {
queryPtr.push({$facet: {count: [{$count: 'count'}], samples: []}});
queryPtr = queryPtr[queryPtr.length - 1].$facet.samples; // add rest of aggregation pipeline into $facet
}