4

GitHub - karaxuna/meerkat: Library to simplify working with mongodb aggregation...

 1 year ago
source link: https://github.com/karaxuna/meerkat
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Meerkat ·

Library to simplify working with mongodb aggregation framework.

Installation

npm i @flibert/meerkat

yarn:

yarn add @flibert/meerkat

Usage:

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.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK