1. Go to this page and download the library: Download survos/key-value-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
survos / key-value-bundle example snippets
$pixy = new Pixy::Reader('school.pixy');
$pixy->select('mo')
foreach ($pixy->)
// inject the service
$id = 'tt123';
$kv = $keyValueService->getStorageBox('dummy.pixy', [
'products' => 'sku,brand,category' // first key is text primary key by default
]);
$kv->select('products'); // so that we don't have to pass it each time.
$kv->set($data); // because they key is in the data.
assert($kv->get($id));
assert($kv->has($id));
assert(json_decode($kv->get($id)) == $data);
//
$kv = $keyValueService->getStorageBox('app.db', [
'movies' => 'imdb_id, year|integer, category|string' // first key is text primary key by default
]);
$rows = $kv->where("year < 2000 and category='drama'")->iterate();
// without the index
$rows = $kv->where("json_extract(value, '$.year') < 2000")->iterate();