NOSQL module for PSFS, aligned with the psfs/core 2.2.x-dev development line.
- Target runtime: PHP 8.3
- Main dependencies:
psfs/core: dev-master(branch alias2.2.x-dev)ext-mongodbmongodb/mongodb:^2.1.2
- Metadata compatibility:
- PHP 8 attributes as the primary contract
- Legacy annotations kept temporarily as fallback
docker compose up -d
docker compose psTypical 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.distcomposer validate --no-check-publish --strict
vendor/bin/phpunit -c src/NOSQL/phpunit.xml.dist- Routes and metadata in APIs/controllers migrated to attributes:
Api,Route,HttpMethod,Injectable,Label,Visible,Action
- Route convention normalized (
Api, notAPi). - 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, andallowDiskUse - configurable string filtering mode (
contains|prefix|exact)
- unified query plan for
The NOSQL CRUD query layer supports these optional request keys:
__string_mode:contains(default),prefix, orexact__cursor_mode:cursor/seek/afterto 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
- PSFS autoload/class errors:
- ensure
composer installran andvendor/is up to date.
- ensure
- Endpoints not discovered:
- check that
metadata.attributes.enabled=truein effective PSFS configuration.
- check that
- MongoDB extension errors:
- verify
ext-mongodbis enabled in runtime (php -m | grep mongodb).
- verify
- Scrutinizer CI:
- install MongoDB extension using
build.environment.php.pecl_extensions: [mongodb].
- install MongoDB extension using
For new APIs or code generated by the module:
- Use attributes as the primary metadata source.
- Keep annotations only if temporary compatibility is needed.
- 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.


