PHPackages                             fifths/php-mongo - 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. [Database &amp; ORM](/categories/database)
4. /
5. fifths/php-mongo

ActiveLibrary[Database &amp; ORM](/categories/database)

fifths/php-mongo
================

php mongodb class

131812[1 PRs](https://github.com/fifths/php-mongo/pulls)PHP

Since Jun 20Pushed 8y ago2 watchersCompare

[ Source](https://github.com/fifths/php-mongo)[ Packagist](https://packagist.org/packages/fifths/php-mongo)[ RSS](/packages/fifths-php-mongo/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

mongodb class
=============

[](#mongodb-class)

```
composer require fifths/php-mongo

```

\##Select Method

- `select` Get select fields from returned documents
- `where` Where section of the query
- `where_in` Where something is in an array of something
- `where_in_all` Where something is in all of an array of \* something
- `where_not_in` Where something is not in array of something
- `where_or` Where something is based on or
- `where_gt` Where something is greater than something
- `where_gte` Where something is greater than or equal to something
- `where_lt` Where something is less than something
- `where_lte` Where something is less than or equal to something
- `where_between` Where something is in between to something
- `where_between_ne` Where something is in between and but not equal to something
- `where_ne` Where something is not equal to something
- `order_by` Order the results
- `limit` OR `offset` Limit the number of returned results
- `count` Document Count based on where query
- `distinct` Retrieve a list of distinct values for the given key across a single collection
- `find` Retrieve single document from collection

\##Update Method

- `set` Sets a field to a value
- `unset_field` Unsets a field
- `addtoset` Adds a value to an array if doesn't exist
- `push` Pushes a value into an array field
- `pop` Pops a value from an array field
- `pull` Removes an array by the value of a field
- `rename_field` Rename a field
- `inc` Increments the value of a field
- `mul` Multiple the value of a field
- `max` Updates the value of the field to a specified value if the specified value is greater than the current value of the field
- `min` Updates the value of the field to a specified value if the specified value is less than the current value of the field.
- `update` Update a single document in a collection
- `update_all` Update all documents in a collection

\##Delete Method

- `delete` Delete a single document in a collection
- `delete_all` Delete all documents in a collection

\##Aggregation Method

- `aggregate` Perform aggregation query on document

\##Index Method

- `add_index` Create a new index on collection
- `remove_index` Remove index from collection
- `list_indexes` Show all index created on collections

\##DB Method

- `switch_db` Switch to a different database
- `drop_db` Drops a database
- `drop_collection` Drops a collection

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.7% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6918354?v=4)[ELon Lee](/maintainers/fifths)[@fifths](https://github.com/fifths)

---

Top Contributors

[![maxlee123456](https://avatars.githubusercontent.com/u/63325897?v=4)](https://github.com/maxlee123456 "maxlee123456 (13 commits)")[![fifths](https://avatars.githubusercontent.com/u/6918354?v=4)](https://github.com/fifths "fifths (2 commits)")

---

Tags

mongophp

### Embed Badge

![Health badge](/badges/fifths-php-mongo/health.svg)

```
[![Health](https://phpackages.com/badges/fifths-php-mongo/health.svg)](https://phpackages.com/packages/fifths-php-mongo)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M117](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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