xtlsoft / nondb
A NoSQL Database Based On Json Storage.
Installs: 190
Dependents: 1
Suggesters: 0
Security: 0
Stars: 19
Watchers: 4
Forks: 26
Open Issues: 1
Requires
- php: >=5.4
This package is auto-updated.
Last update: 2024-10-25 17:48:37 UTC
README
NonDB Stands for None DB.
Install 安装
composer install xtlsoft/nondb
Usage 使用
<?php require_once "vendor/autoload.php"; use \NonDB\NonDB; $db = new NonDB( NonDB::driver('LocalDriver:./data/') ); $name = $db->table('test')->getAll()[0]->another[0]->name; $person = $db->table('person')->create(); $person->id = $person->parent()->autoincrement(); $person->name = $name; $person->hobbies = ['swimming', 'dancing']; $person->location = $db->table('location')[10]->name; $person->save(); $anotherPerson = $person->parent()->find(NonDB::where('location', '%China%')); $anotherPerson->setMode('id', NonDB::Auto)->save(); echo $anotherPerson->name; echo $db->dump(\NonDB\Components\Dump::DUMP_JSON_PRETTY);