PHPackages                             myaaghubi/mhm-json-db - 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. myaaghubi/mhm-json-db

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

myaaghubi/mhm-json-db
=====================

A lite JSON base database for PHP.

v1.0(8mo ago)06agpl-3.0PHPPHP &gt;=8.1CI passing

Since Aug 23Pushed 7mo agoCompare

[ Source](https://github.com/myaaghubi/mhm-json-db)[ Packagist](https://packagist.org/packages/myaaghubi/mhm-json-db)[ RSS](/packages/myaaghubi-mhm-json-db/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

MHM JSON Database
=================

[](#mhm-json-database)

[![UnitTest](https://github.com/myaaghubi/mhm-json-db/actions/workflows/php.yml/badge.svg?branch=main)](https://github.com/myaaghubi/mhm-json-db/actions/workflows/php.yml)[![PHP Version Tested](https://camo.githubusercontent.com/b37db47746bb49d291c47c3cc8fabd15219dc271ef4a998933fcd59e950d22b3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e342d626c7565)](https://img.shields.io/badge/PHP-8.4-blue)

Usage
-----

[](#usage)

### Composer

[](#composer)

For the composer, have it like:

```
composer require myaaghubi/mhm-json-db
```

### Code

[](#code)

```
    $db = new MHMJsonDB('mydb.json', $pathToDB);

    // select all: array of arrays or an empty array
    var_dump($db->select());

    // select multiple: array of arrays or an empty array
    // sort: $db->select(['name' => 'Moham'], 'name', true);
    var_dump($db->select(['name' => 'Moham']));

    // select one item/array or null
    $result = $db->selectOne(['name' => 'Moham']);

    // returns the whole record as an array
    $insertedRecord = $db->insert(['name' => 'Moham', 'email' => '...']);

    // returns true or false
    $insertedRecord = $db->update(['name' => 'Moham', ...], ['name' => 'Mohammad', ...]);

    // delete multiple: returns the number of deleted
    $deleted = $db->delete(['id' => $insertedRecord['id']]);

    // delete all
    $deleted = $db->delete();
```

### Test

[](#test)

Just run `./vendor/bin/phpunit`

License
-------

[](#license)

This project is licensed under an AGPL-3.0 license.

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance66

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

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

Unknown

Total

1

Last Release

259d ago

### Community

Maintainers

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

---

Top Contributors

[![myaaghubi](https://avatars.githubusercontent.com/u/4276074?v=4)](https://github.com/myaaghubi "myaaghubi (22 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/myaaghubi-mhm-json-db/health.svg)

```
[![Health](https://phpackages.com/badges/myaaghubi-mhm-json-db/health.svg)](https://phpackages.com/packages/myaaghubi-mhm-json-db)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M542](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M209](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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