Problem
modules/billing/repositories/billing.extraBalance.repository.js uses \$sortArray in an aggregation pipeline, which requires MongoDB 5.2+. The integration test billing.extraBalance.listLedger.perf.integration.tests.js (added in devkit) fails on local environments running MongoDB 5.0.x:
MongoServerError: Invalid \$project :: caused by :: Unrecognized expression '\$sortArray'
Discovered during /update-stack on pierreb_node (local MongoDB 5.0.7).
Affected files
modules/billing/repositories/billing.extraBalance.repository.js (line ~425)
modules/billing/tests/billing.extraBalance.listLedger.perf.integration.tests.js
Steps to reproduce
- Run against MongoDB 5.0.x:
NODE_ENV=pierreb npm run test:integration
- The
listLedgerPage integration tests fail with Unrecognized expression '$sortArray'
Fix options
- Either document MongoDB ≥5.2 as a minimum requirement in README
- Or replace
\$sortArray with a \$sort stage on the outer pipeline (compatible with 5.0)
Problem
modules/billing/repositories/billing.extraBalance.repository.jsuses\$sortArrayin an aggregation pipeline, which requires MongoDB 5.2+. The integration testbilling.extraBalance.listLedger.perf.integration.tests.js(added in devkit) fails on local environments running MongoDB 5.0.x:Discovered during
/update-stackonpierreb_node(local MongoDB 5.0.7).Affected files
modules/billing/repositories/billing.extraBalance.repository.js(line ~425)modules/billing/tests/billing.extraBalance.listLedger.perf.integration.tests.jsSteps to reproduce
NODE_ENV=pierreb npm run test:integrationlistLedgerPageintegration tests fail withUnrecognized expression '$sortArray'Fix options
\$sortArraywith a\$sortstage on the outer pipeline (compatible with 5.0)