Importante

Você está vendo a versão anterior da nova experiência da Alura que estamos preparando para você. Em breve, ela ganha uma identidade visual novinha totalmente pensada em potencializar seus estudos!

2
respostas

Esse comando não existe. Seria uma melhor prática usar o INCRBYFLOAT com negativo?

(error) ERR unknown command 'DECRBYFLOAT'

2 respostas

Opa Bruno, olhando a documentação do redis ele não fala sobre esse comando. Tem o decr, mas não seguido pelo tipo do dado => https://redis.io/commands/decrby

De acordo com a documentação, deve ser utilizado o INCRBYFLOAT negativo...

Increment the string representing a floating point number stored at key by the specified increment. By using a negative increment value, the result is that the value stored at the key is decremented (by the obvious properties of addition). If the key does not exist, it is set to 0 before performing the operation. An error is returned if one of the following conditions occur: