MongoHybrid\Client::getKey PHP Method

getKey() public method

Get value for specific key
public getKey ( string $collection, string $key, mixed $default = null ) : mixed
$collection string
$key string
$default mixed
return mixed
    public function getKey($collection, $key, $default = null)
    {
        $entry = $this->driver->findOne($collection, ['key' => $key]);
        return $entry ? $entry['val'] : $default;
    }