PHPackages                             patchlevel/rango - 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. patchlevel/rango

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

patchlevel/rango
================

A high-performance reimplementation of the MongoDB PHP API on top of PostgreSQL JSONB

1.0.0(2mo ago)102.4k[1 PRs](https://github.com/patchlevel/rango/pulls)1MITPHPPHP ~8.3.0 || ~8.4.0 || ~8.5.0CI passing

Since Feb 21Pushed 2w ago3 watchersCompare

[ Source](https://github.com/patchlevel/rango)[ Packagist](https://packagist.org/packages/patchlevel/rango)[ Docs](https://github.com/patchlevel/hydrator)[ RSS](/packages/patchlevel-rango/feed)WikiDiscussions 1.1.x Synced 2d ago

READMEChangelog (5)Dependencies (18)Versions (9)Used By (1)

[![Mutation testing badge](https://camo.githubusercontent.com/3e2ce5e26fe8135d54c8e2c86af8d2208e8c9b01fdf2c6aa1bf6ceaf18c76521/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d25324670617463686c6576656c25324672616e676f253246312e312e78)](https://dashboard.stryker-mutator.io/reports/github.com/patchlevel/rango/1.1.x)[![Latest Stable Version](https://camo.githubusercontent.com/4c4b9fc2d2bcd9f0e00f3c52bb31a4a1965439f0fd081af592dc6e499e640a51/68747470733a2f2f706f7365722e707567782e6f72672f70617463686c6576656c2f72616e676f2f76)](https://packagist.org/packages/patchlevel/rango)[![License](https://camo.githubusercontent.com/dd572872b93ba4c89ebe2f50b678f9ff9d2bf4b45caa9804ccdd14c569ad1302/68747470733a2f2f706f7365722e707567782e6f72672f70617463686c6576656c2f72616e676f2f6c6963656e7365)](https://packagist.org/packages/patchlevel/rango)

Rango
=====

[](#rango)

 [![](logo.png)](logo.png)

Rango is a high-performance PHP library that reimplements the **MongoDB PHP API** on top of **PostgreSQL** using the power of `JSONB`.

It provides a drop-in compatible API, allowing you to use familiar MongoDB-style operations while storing your data in a reliable PostgreSQL database. This is ideal for applications that want to leverage PostgreSQL's ACID compliance and ecosystem without giving up the flexible document-based development experience of MongoDB.

Features
--------

[](#features)

- [Drop-in MongoDB API](https://patchlevel.dev/docs/rango/latest/getting-started) with `Client`, `Database`, and `Collection`
- [CRUD operations](https://patchlevel.dev/docs/rango/latest/crud-operations) like `insertOne`, `find`, `updateMany`, and `deleteOne`
- [Rich query operators](https://patchlevel.dev/docs/rango/latest/querying) such as `$gt`, `$in`, `$or`, and `$elemMatch`
- [Update operators](https://patchlevel.dev/docs/rango/latest/update-operators) like `$set`, `$inc`, `$push`, and `$rename`
- [Projection and sorting](https://patchlevel.dev/docs/rango/latest/querying#projection) with dot-notation support
- [Aggregation pipelines](https://patchlevel.dev/docs/rango/latest/aggregation) with `$match`, `$group`, `$unwind`, and `$lookup`
- [Bulk writes](https://patchlevel.dev/docs/rango/latest/crud-operations#bulk-writes) wrapped in a single transaction
- [Index management](https://patchlevel.dev/docs/rango/latest/indexes) backed by native PostgreSQL indexes

Installation
------------

[](#installation)

```
composer require patchlevel/rango
```

Documentation
-------------

[](#documentation)

- Latest [Docs](https://patchlevel.dev/docs/rango/latest)
- Related [Blog](https://patchlevel.dev/blog)

Integration
-----------

[](#integration)

- [odm](https://github.com/patchlevel/odm)
- [event-sourcing](https://github.com/patchlevel/event-sourcing)
- [hydrator](https://github.com/patchlevel/hydrator)

Contributing
------------

[](#contributing)

We are open to contributions as long as they are in line with our [BC-Policy](https://patchlevel.dev/our-backward-compatibility-promise).

Also note that the `composer.lock` is always generated with the newest supported PHP version as this is the version our tools run in the CI.

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance90

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% 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 ~18 days

Total

7

Last Release

19d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/470138?v=4)[David Badura](/maintainers/DavidBadura)[@DavidBadura](https://github.com/DavidBadura)

---

Top Contributors

[![DavidBadura](https://avatars.githubusercontent.com/u/470138?v=4)](https://github.com/DavidBadura "DavidBadura (30 commits)")[![DanielBadura](https://avatars.githubusercontent.com/u/2017762?v=4)](https://github.com/DanielBadura "DanielBadura (3 commits)")

---

Tags

postgresmongodb

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/patchlevel-rango/health.svg)

```
[![Health](https://phpackages.com/badges/patchlevel-rango/health.svg)](https://phpackages.com/packages/patchlevel-rango)
```

###  Alternatives

[mongodb/mongodb

MongoDB driver library

1.6k67.9M625](/packages/mongodb-mongodb)[doctrine/mongodb-odm

PHP Doctrine MongoDB Object Document Mapper (ODM) provides transparent persistence for PHP objects to MongoDB.

1.1k24.5M359](/packages/doctrine-mongodb-odm)[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58825.9M54](/packages/scienta-doctrine-json-functions)[phpbu/phpbu

PHP Backup utility.

1.3k95.3k4](/packages/phpbu-phpbu)[apix/cache

A thin PSR-6 cache wrapper with a generic interface to various caching backends emphasising cache taggging and indexing to Redis, Memcached, PDO/SQL, APC and other adapters.

117548.2k6](/packages/apix-cache)[rybakit/phive-queue

$queue-&gt;push('I can be popped off after', '10 minutes');

16541.9k1](/packages/rybakit-phive-queue)

PHPackages © 2026

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