PHPackages                             imyangjin/yii2-mysql-json - 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. imyangjin/yii2-mysql-json

ActiveYii2-extension[Database &amp; ORM](/categories/database)

imyangjin/yii2-mysql-json
=========================

extend yii2-ActiceRecord And yii2-ActiveQuery with use mysql json make simple.

1.0.2(7y ago)136342PHP

Since Oct 19Pushed 7y ago2 watchersCompare

[ Source](https://github.com/imyangjin/yii2-mysql-json)[ Packagist](https://packagist.org/packages/imyangjin/yii2-mysql-json)[ RSS](/packages/imyangjin-yii2-mysql-json/feed)WikiDiscussions master Synced yesterday

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

Yii2 Mysql Json
===============

[](#yii2-mysql-json)

The extension yii2-ActiceRecord And yii2-ActiveQuery with use mysql json make simple.

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

[](#installation)

The preferred way to install this extension is through composer.

Either run

> composer require --prefer-dist imyangjin/yii2-mysql-json

or add

> "imyangjin/yii2-mysql-json": "~1.0"

to the require section of your `composer.json`.

Basic Usage
-----------

[](#basic-usage)

Your Model file must extend this extension class；

```
use Imyangji\Yii2MysqlJson\ActiveRecordJson；

class YourModel extent ActiveRecordJson
{

}

```

Then if you want to use it to search column with json.

### jsonWhere

[](#jsonwhere)

This func like use `Model::find()->where(\[Query::where()\])`; column search is `column->"$.jsonColumn1.jsonColumn2..."`;

```
public function search()
{
    YourModel::findJson()
        ->jsonWhere(['content->"$.en.content"' => 'who'])
        ->jsonWhere(['>', 'content->"$.en.content"' , 'who'])
}

```

### jsonContainsWhere

[](#jsoncontainswhere)

This func Support mysql `JSON_CONTAINS(target, candidate[, path])`; This query is equivalent to the query, but the difference is that the query is an inclusion relation, that is, the field contains the value of the value; Column A multilevel field supporting JSON fields is segmented using '.';

```
public function search()
{
    YourModel::findJson()
        ->jsonContainsWhere('content.en.content', 'who')
}

```

### jsonExtractWhere

[](#jsonextractwhere)

This func Support JSON\_EXTRACT(json\_doc, path\[, path\] ...) in query; Column A multilevel field supporting JSON fields is segmented using '.'; Can use operate to search。

```
public function search()
{
    YourModel::findJson()
        ->jsonContainsWhere('content.en.content', 'who', '>')
}

```

### jsonSelect

[](#jsonselect)

This func Support JSON\_EXTRACT(json\_doc, path) AS `xx` in query select; Column A multilevel field supporting JSON fields is segmented using '.';

```
public function search()
{
    YourModel::findJson()
        ->jsonSelect(['content.en.content', 'content.en.text' => 'tt']])
}

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

Every ~27 days

Total

3

Last Release

2709d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9957328?v=4)[NeilYoung](/maintainers/imyangjin)[@imyangjin](https://github.com/imyangjin)

---

Top Contributors

[![imyangjin](https://avatars.githubusercontent.com/u/9957328?v=4)](https://github.com/imyangjin "imyangjin (16 commits)")

---

Tags

jsonmysqlyii2extensionmysql json

### Embed Badge

![Health badge](/badges/imyangjin-yii2-mysql-json/health.svg)

```
[![Health](https://phpackages.com/badges/imyangjin-yii2-mysql-json/health.svg)](https://phpackages.com/packages/imyangjin-yii2-mysql-json)
```

###  Alternatives

[tigrov/yii2-pgsql

Improved PostgreSQL schemas for Yii2

3467.0k](/packages/tigrov-yii2-pgsql)[johnitvn/yii2-ajaxcrud

Gii CRUD template for Single Page Ajax Administration for yii2

97209.6k16](/packages/johnitvn-yii2-ajaxcrud)[sjaakp/yii2-spatial

Yii2 ActiveRecord supporting MySQL spatial data

1873.8k1](/packages/sjaakp-yii2-spatial)[dmstr/yii2-migrate-command

Console Migration Command with multiple paths/aliases support

31295.5k6](/packages/dmstr-yii2-migrate-command)[dmstr/yii2-db

Database extensions

19618.8k6](/packages/dmstr-yii2-db)

PHPackages © 2026

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