Library to simplify working with mongodb aggregation framework.
npm:
npm i @flibert/meerkat
yarn:
yarn add @flibert/meerkat
import { paginate, match, sort } from '@flibbert/meerkat';
db.getCollection('subscriptions').aggregate([
...match({
status: 'active',
}),
...sort({
createdAt: -1,
}),
...paginate({
skip: 0,
limit: 100,
}),
]);
See tests for more examples.