PHPackages                             psfs/nosql - 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. [API Development](/categories/api)
4. /
5. psfs/nosql

ActiveLibrary[API Development](/categories/api)

psfs/nosql
==========

NOSQL package for PSFS

1.0.2(1mo ago)0233↓26.7%2MITPHPPHP &gt;=8CI passing

Since Jun 3Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/psfs/nosql)[ Packagist](https://packagist.org/packages/psfs/nosql)[ Docs](https://github.com/psfs/nosql)[ RSS](/packages/psfs-nosql/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (10)Versions (5)Used By (0)

PSFS NOSQL
==========

[](#psfs-nosql)

[![Build Status](https://camo.githubusercontent.com/5fa4620db4610580da14f01bdc7d8a9a4ce80951428eff9cbd29afd1ff553bbc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f707366732f6e6f73716c2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/psfs/nosql/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ef1cb7bdd9a59f819a3d1c78b7b1e34e68d6a956e8c6c67e9fa970d6319b14cd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f707366732f6e6f73716c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/psfs/nosql/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/fb2c0e82e8c189e6eb49cd8ce2293feb3db2590f833cc5a87cf1ab715521890e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f707366732f6e6f73716c2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/psfs/nosql/?branch=master)[![Packagist Stable Version](https://camo.githubusercontent.com/30f3f468fabe4663a07a892bbc109365ccfda8e21c94f1da83876e130b60b4fd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f707366732f6e6f73716c)](https://packagist.org/packages/psfs/nosql)[![PHP 8.3](https://camo.githubusercontent.com/6fb4fa43a4fd01011e071367ba9219a31399b8615ba0c56bba733799ce5a0845/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332d3737374242342e7376673f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.net/releases/8.3/en.php)

NOSQL module for PSFS, aligned with the `psfs/core 2.2.x-dev` development line.

Technical Baseline
------------------

[](#technical-baseline)

- Target runtime: PHP 8.3
- Main dependencies:
    - `psfs/core: dev-master` (branch alias `2.2.x-dev`)
    - `ext-mongodb`
    - `mongodb/mongodb:^2.1.2`
- Metadata compatibility:
    - PHP 8 attributes as the primary contract
    - Legacy annotations kept temporarily as fallback

Local Development (Docker)
--------------------------

[](#local-development-docker)

```
docker compose up -d
docker compose ps
```

Typical PHP container name: `nosql-php-1`.

```
docker exec nosql-php-1 php -v
docker exec nosql-php-1 composer install
docker exec nosql-php-1 php vendor/bin/phpunit -c src/NOSQL/phpunit.xml.dist
```

Minimum Validation
------------------

[](#minimum-validation)

```
composer validate --no-check-publish --strict
vendor/bin/phpunit -c src/NOSQL/phpunit.xml.dist
```

Implemented Upgrade Contracts
-----------------------------

[](#implemented-upgrade-contracts)

- Routes and metadata in APIs/controllers migrated to attributes:
    - `Api`, `Route`, `HttpMethod`, `Injectable`, `Label`, `Visible`, `Action`
- Route convention normalized (`Api`, not `APi`).
- Generator templates updated to emit attributes in newly generated code.
- PHPUnit configuration migrated to 11.5 schema.
- GitHub Actions CI added for `composer validate` + tests.
- CRUD query planner optimized with:
    - unified query plan for `find/count/deleteMany`
    - strict custom pipeline whitelist
    - index metadata caching
    - cursor-mode pagination support (seek/after)
    - optional query `hint`, `maxTimeMS`, and `allowDiskUse`
    - configurable string filtering mode (`contains|prefix|exact`)

Query Planner Options
---------------------

[](#query-planner-options)

The NOSQL CRUD query layer supports these optional request keys:

- `__string_mode`: `contains` (default), `prefix`, or `exact`
- `__cursor_mode`: `cursor`/`seek`/`after` to enable cursor pagination
- `__after`: JSON object with sort field values for cursor pagination
- `__hint`: index hint (string or object)
- `__maxTimeMS`: max execution time for query operations
- `__allowDiskUse`: enable disk usage for aggregation if needed
- `__collation`: explicit collation object

Automatic index recommendations in `syncCollections` can be enabled with:

- `nosql.sync.autoIndexes=true`

Quick Troubleshooting
---------------------

[](#quick-troubleshooting)

- PSFS autoload/class errors:
    - ensure `composer install` ran and `vendor/` is up to date.
- Endpoints not discovered:
    - check that `metadata.attributes.enabled=true` in effective PSFS configuration.
- MongoDB extension errors:
    - verify `ext-mongodb` is enabled in runtime (`php -m | grep mongodb`).
- Scrutinizer CI:
    - install MongoDB extension using `build.environment.php.pecl_extensions: [mongodb]`.

Migration: annotations -&gt; attributes
---------------------------------------

[](#migration-annotations---attributes)

For new APIs or code generated by the module:

1. Use attributes as the primary metadata source.
2. Keep annotations only if temporary compatibility is needed.
3. Avoid introducing new routes or methods only in annotation format.

This reduces legacy fallback usage and aligns the module with the current `psfs/core` contract.

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance89

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.4% 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 ~341 days

Total

4

Last Release

55d ago

PHP version history (2 changes)1.0.0PHP &gt;=8.3

1.0.1PHP &gt;=8

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b003d22a9e86075d99de95d22b758300f600cd3c3c8eabc11cea31fe53ea81e?d=identicon)[c15k0](/maintainers/c15k0)

---

Top Contributors

[![c15k0](https://avatars.githubusercontent.com/u/2992619?v=4)](https://github.com/c15k0 "c15k0 (28 commits)")[![gabmarfer](https://avatars.githubusercontent.com/u/2932209?v=4)](https://github.com/gabmarfer "gabmarfer (4 commits)")[![salvadorcastro](https://avatars.githubusercontent.com/u/9199419?v=4)](https://github.com/salvadorcastro "salvadorcastro (2 commits)")

---

Tags

nosqlphppsfsrestfulphpapilibrarynosqlrestfulpsfs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/psfs-nosql/health.svg)

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

###  Alternatives

[obiefy/api-response

Simple Laravel package to return Json responses.

17324.6k](/packages/obiefy-api-response)[mikealmond/musicbrainz

A PHP library for accessing the MusicBrainz API

6385.1k1](/packages/mikealmond-musicbrainz)

PHPackages © 2026

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