Example #1
0
            var_dump($record);
            if ($status != Aerospike::OK) {
                echo "\nMultiget failed at " . $i . "th record";
            }
        }
        $db->close();
    } else {
        echo "Aerospike DB connection is not established";
    }
});
$app->put('/append', function () use($db) {
    if ($db->isConnected()) {
        $key = $db->initKey("test", "demo", "key_append");
        $record = array("name" => "John", "age" => 32);
        $status = $db->put($key, $record);
        $status = $db->append($key, 'name', ' Watson', array(Aerospike::OPT_WRITE_TIMEOUT => 1000));
        if ($status != Aerospike::OK) {
            echo "\nAppend operation failed";
        } else {
            echo "\nValue appended successfully";
            $db->get($key, $record);
            var_dump($record);
        }
        $db->remove($key);
        $db->close();
    } else {
        echo "Aerospike DB connection is not established";
    }
});
$app->put('/multiappend', function () use($db) {
    if ($db->isConnected()) {