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

ActiveLibrary

jmhc/mongodb
============

Hyperf mongodb.

176PHP

Since Nov 29Pushed 6y ago1 watchersCompare

[ Source](https://github.com/jumihc-company/mongodb)[ Packagist](https://packagist.org/packages/jmhc/mongodb)[ RSS](/packages/jmhc-mongodb/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

介绍
--

[](#介绍)

简单移植 `jenssegers/mongodb` , 使其能够运行在 [hyperf](https://github.com/hyperf/hyperf) 下。

安装
--

[](#安装)

使用以下命令安装：

```
composer require jmhc/mongodb

```

配置
--

[](#配置)

> 配置路径为 `config/autoload/databases.php`
>
> 详细配置参考 [configuration](https://github.com/jenssegers/laravel-mongodb#configuration)

配置示例：

```
    ...
    'mongodb' => [
        'driver'   => 'mongodb',
        'host'     => env('MONGODB_HOST', 'mongo'),
        'port'     => env('MONGODB_PORT', 27017),
        'database' => env('MONGODB_DATABASE', 'mongo'),
        'username' => env('MONGODB_USERNAME', ''),
        'password' => env('MONGODB_PASSWORD', ''),
        'options'  => [
            'database' => env('MONGODB_AUTH_DATABASE', 'admin'),
        ],
        'pool' => [
            'min_connections' => 1,
            'max_connections' => 10,
            'connect_timeout' => 10.0,
            'wait_timeout' => 3.0,
            'heartbeat' => -1,
            'max_idle_time' => (float) env('MONGODB_MAX_IDLE_TIME', 60),
        ],
    ],
```

使用
--

[](#使用)

> 需要配置数据库链接 `driver` 为 `mongodb`
>
> 默认使用 `mongodb` 链接

```
use Jmhc\Mongodb\Eloquent\Model;

class Message extends Model
{}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2263baf3d3c09bc52fb734b0b5ad1e9b17905738b4d0029a328b789c79092ee7?d=identicon)[jmhc](/maintainers/jmhc)

---

Top Contributors

[![linshaowl](https://avatars.githubusercontent.com/u/19506950?v=4)](https://github.com/linshaowl "linshaowl (17 commits)")

### Embed Badge

![Health badge](/badges/jmhc-mongodb/health.svg)

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

PHPackages © 2026

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