PHPackages                             thesebas/php-mongodb-helpers - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. thesebas/php-mongodb-helpers

ActiveLibrary

thesebas/php-mongodb-helpers
============================

MongoDB php helpers to build queries

v0.0.4(8y ago)013PHPPHP ^5.6|^7.0

Since Aug 14Pushed 7y ago1 watchersCompare

[ Source](https://github.com/thesebas/php-mongodb-helpers)[ Packagist](https://packagist.org/packages/thesebas/php-mongodb-helpers)[ RSS](/packages/thesebas-php-mongodb-helpers/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

php-mongodb-helpers
===================

[](#php-mongodb-helpers)

MongoDB php helpers to build queries. [![BUILD STATUS](https://camo.githubusercontent.com/fbeb770caab4934859fc982b207b9b16e8453a6af28d715951996b4d1f261a31/68747470733a2f2f6170692e7472617669732d63692e6f72672f74686573656261732f7068702d6d6f6e676f64622d68656c706572732e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/fbeb770caab4934859fc982b207b9b16e8453a6af28d715951996b4d1f261a31/68747470733a2f2f6170692e7472617669732d63692e6f72672f74686573656261732f7068702d6d6f6e676f64622d68656c706572732e7376673f6272616e63683d6d6173746572) [![Coverage Status](https://camo.githubusercontent.com/77cf4b4cf72255a0850b0c4fd57df378e5a4723124f0b47b350b6a0a6d049234/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f74686573656261732f7068702d6d6f6e676f64622d68656c706572732f62616467652e737667)](https://coveralls.io/github/thesebas/php-mongodb-helpers)

Write this:

```
$collection->aggregate([

  project([
      'field' => reduce(
          filter(
              path(...$arrayField),
              'tmp',
              eq(variable("tmp", ...$filterField), $filterValue)
          ),
          0,
          add(variable('value'), variable("this", $sumField))
      )
  ])

]);
```

instead of this:

```
$collection->aggregate([
  ['$project' => [
      'field' => ['$reduce' => [
          'input' => ['$filter' => [
              'input' => '$' . join('.', $arrayField),
              'as' => 'tmp',
              'cond' => ['$eq' => ["\$\$tmp." . join('.', $filterField), $filterValue]]
          ]],
          'initialValue' => 0,
          'in' => [
              '$add' => ['$$value', '$$this.' . $sumField]
          ]
      ]]
  ]]
]);
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

4

Last Release

3174d ago

PHP version history (3 changes)0.0.1PHP 5.6

0.0.2PHP &gt;=5.6

v0.0.4PHP ^5.6|^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e88ca2d7f73ceff94c308858b21961859448f73770f40d230788e9e947317297?d=identicon)[thesebas](/maintainers/thesebas)

---

Top Contributors

[![thesebas](https://avatars.githubusercontent.com/u/827416?v=4)](https://github.com/thesebas "thesebas (11 commits)")

---

Tags

mongodbphpquery-builder

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thesebas-php-mongodb-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/thesebas-php-mongodb-helpers/health.svg)](https://phpackages.com/packages/thesebas-php-mongodb-helpers)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
