PHPackages                             xcgu/amphp-mongodb - 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. xcgu/amphp-mongodb

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

xcgu/amphp-mongodb
==================

Asynchronous MongoDB client for PHP based on Amp.

v1.1.0(5mo ago)00MITPHPPHP &gt;=8.1

Since Oct 31Pushed 5mo agoCompare

[ Source](https://github.com/xcgu/amphp-mongodb)[ Packagist](https://packagist.org/packages/xcgu/amphp-mongodb)[ RSS](/packages/xcgu-amphp-mongodb/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (3)Used By (0)

xcgu/amphp-mongodb
==================

[](#xcguamphp-mongodb)

[![MIT License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://github.com/xcgu/amphp-mongodb/blob/main/LICENSE)[![PHP Version](https://camo.githubusercontent.com/f870cee2a2e2a442c6b62c8bf79f45ec0ce794dc5af13834902518c9107230f9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e312532422d626c75652e737667)](https://php.net)

Async MongoDB client for PHP based on [AMPHP](https://amphp.org) and [Revolt](https://revolt.run).

This library provides a non-blocking, concurrent MongoDB client that leverages PHP fibers for truly asynchronous database operations.

Features
--------

[](#features)

- **Fully Async**: Built on AMPHP v3 with Revolt event loop
- **Connection Pooling**: Efficient connection management with automatic cleanup
- **Authentication**: SCRAM-SHA-256 and SCRAM-SHA-1 support
- **Complete CRUD Operations**: Insert, find, update, delete with full options support
- **Aggregation Pipeline**: Execute complex aggregation queries
- **Transactions**: Full multi-document transaction support
- **Wire Protocol**: Native MongoDB wire protocol (OP\_MSG) implementation
- **Type-Safe**: Modern PHP 8.1+ with strict types and readonly properties
- **Concurrent Operations**: Execute multiple queries in parallel

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

[](#installation)

```
composer require xcgu/amphp-mongodb
```

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- MongoDB 3.6+ (for OP\_MSG support)

Quick Start
-----------

[](#quick-start)

```
