MongoHybrid\Client::hincrby PHP Метод

hincrby() публичный Метод

Increment the integer value of a hash field by the given number
public hincrby ( $collection, string $key, string $field, integer $by = 1 ) : integer
$key string
$field string
$by integer
Результат integer
    public function hincrby($collection, $key, $field, $by = 1)
    {
        $current = $this->hget($collection, $key, $field, 0);
        $newone = $current + $by;
        $this->hset($collection, $key, $field, $newone);
        return $newone;
    }