MongoHybrid\Client::hincrby PHP Method

hincrby() public method

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
return 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;
    }