PHPackages                             r0mdau/jisly - 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. r0mdau/jisly

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

r0mdau/jisly
============

The smallest NoSQL database library, flat file JSON.

2.2.0(2y ago)27624[1 issues](https://github.com/r0mdau/jisly/issues)Apache-2.0PHPPHP &gt;=8.2CI failing

Since Nov 12Pushed 3mo ago4 watchersCompare

[ Source](https://github.com/r0mdau/jisly)[ Packagist](https://packagist.org/packages/r0mdau/jisly)[ Docs](https://github.com/r0mdau/jisly)[ RSS](/packages/r0mdau-jisly/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (1)Dependencies (6)Versions (9)Used By (0)

Jisly
=====

[](#jisly)

[![PHPUnit](https://github.com/r0mdau/jisly/actions/workflows/unit-tests.yml/badge.svg)](https://github.com/r0mdau/jisly/actions/workflows/unit-tests.yml/badge.svg)[![Coverage Status](https://camo.githubusercontent.com/bd4a557b09cb0dcda3f56f5d6fa9f2849094409faf7b3e0821d7719d919da233/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f72306d6461752f6a69736c792f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/r0mdau/jisly?branch=main)[![Known Vulnerabilities](https://camo.githubusercontent.com/1e95e6c913c54aa57449cd1f13a23d853f43d050f3f8f552b2d88d97f333ab82/68747470733a2f2f736e796b2e696f2f746573742f6769746875622f72306d6461752f6a69736c792f62616467652e737667)](https://snyk.io/test/github/r0mdau/jisly)

The smallest PHP lightweight NoSQL database library, flat file JSON.

The main goal of Jisly is to allow you to quickly start your project with the possibility of memory and flat-file storage using a NoSQL (document oriented) query syntax.

[Version française ici](https://github.com/r0mdau/jisly/blob/main/README.fr.md)

**Concurrent access is managed !**

How to install and load
=======================

[](#how-to-install-and-load)

This lib can be found on [Packagist](https://packagist.org/packages/r0mdau/jisly)

```
composer require r0mdau/jisly:^2.0

```

Loading the library
-------------------

[](#loading-the-library)

Jisly relies on the [PSR-4 specification](https://www.php-fig.org/psr/psr-4/) for autoloading classes from file paths.

```
use Jisly\JislyCollection;

public function saveCart(): void {
    $jisly = new JislyCollection("/tmp/data", "cart");
    ...
}

```

Definitions
===========

[](#definitions)

1. Each document has a unique identifier called `_rid`.
2. Each collection is physically represented by a file.
3. The files are stored in a single working directory. The Jisly class is instantiated with the path to this directory as a parameter.
4. Each time you CRUD something, all datas are stored in memory.
5. And datas are saved on filesystem.

Examples of use
===============

[](#examples-of-use)

Initialization of the class
---------------------------

[](#initialization-of-the-class)

`$directory` contains the path to the directory where the files (=collections) of the data model will be stored.

```
$database = new Jisly($directory);
```

To access a collection
----------------------

[](#to-access-a-collection)

`$name` contains the name of the collection we want to request. Example : `user`.

Returns an object **JislyCollection** :

```
$database->collection($name);
```

Warning : each first time you access a collection, all datas are stored in memory.

To call a collection
--------------------

[](#to-call-a-collection)

**PREAMBLE :**The Insert, Update, Delete methods return a boolean, `true` if the action went well, `false` otherwise.

### Insert method

[](#insert-method)

Insert the array into the specified collection in JSON format and assigns a unique `_rid` identifier to the document if it has not been specified :

```
$successBool = $database->collection($file)->insert(
  [
    "name" => "Lucas",
    "firstname" => "Georges"
  ]
);
```

### Delete method

[](#delete-method)

*You must first find all documents to delete to provide the `_rid` attribute to the delete method.*

Remove the only document in the collection which has the value `$rid` to the attribute `_rid` :

```
$successBool = $database->collection($file)->delete($rid);
```

### Select method

[](#select-method)

Returns all documents in the collection in an **array()** of objects :

```
$results = $database->collection($file)->find();
```

Return all documents in the collection that have a `name` attribute with `Lucas` as value in an **array()** of objects :

```
$results = $database->collection($file)->find(
  [
    "name" => "Lucas"
  ]
);
```

Return the first document that as a `name` attribute with `19` as an object value :

```
$result = $database->collection($file)->findOne(
  [
    "name" => 19
  ]
);
```

#### Logical operators OR and AND

[](#logical-operators-or-and-and)

These two logical operators can be used on `find` and `findOne` methods.

If no logical operator is provided, **OR** is used.

Return all documents in the collection that have a `name` attribute with `Lucas` **OR** a `firstname` attribute with `Georges` as values in an **array()** of objects :

```
$result = $database->collection($file)->find(
  [
    "firstname" => "Georges",
    "name" => "Lucas"
  ], JislyCollection::LOGICAL_OR
);
```

Return the first document in the collection that have a `name` attribute with `Lucas` **AND** a `firstname` attribute with `Georges` as an object value :

```
$result = $database->collection($file)->findOne(
  [
    "firstname" => "Georges",
    "name" => "Lucas"
  ], JislyCollection::LOGICAL_AND
);
```

### Update method

[](#update-method)

For the modification, the documents concerned are entirely replaced by the second **array()** given in parameter.

*You must first find all the documents to replace to provide the `_rid` attribute to the update method.*

Modify the only document in the collection whose value $rid to the `_rid` attribute :

```
$successBool = $database->collection($file)->update(
  $rid,
  [
    "firstname" => "Georges",
    "name" => "Lucas"
  ]
);
```

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance53

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 91.8% 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 ~536 days

Recently: every ~546 days

Total

6

Last Release

835d ago

Major Versions

1.0.0 → 2.0.02018-03-24

PHP version history (5 changes)1.0.0PHP &gt;=5.4

2.0.0PHP &gt;=7.2

2.0.2PHP &gt;=7.4

2.1.0PHP &gt;=8.1

2.2.0PHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3662999?v=4)[Romain Dauby](/maintainers/r0mdau)[@r0mdau](https://github.com/r0mdau)

---

Top Contributors

[![r0mdau](https://avatars.githubusercontent.com/u/3662999?v=4)](https://github.com/r0mdau "r0mdau (78 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")

---

Tags

databasefile-storageflatfilejsonnosqlnosql-databasepackagistphpstorage-enginezero-dependency

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/r0mdau-jisly/health.svg)

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198628.3k10](/packages/pgvector-pgvector)

PHPackages © 2026

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