Latest web development tutorials

comando Redis getRange

stringa di Redis (stringa)

Redis comando getRange viene utilizzato per ottenere una sottostringa nella stringa memorizzata nella chiave specificata. String gamma intercettazione da parte l'inizio e la fine offset due decisioni (tra cui inizio e fine in dotazione).

grammatica

Redis getRange sintassi dei comandi di base è la seguente:

redis 127.0.0.1:6379> GETRANGE KEY_NAME start end

versioni disponibili

> = 2.4.0

Valore di ritorno

Intercettazione sottostringa ottenuto.

Esempi

In primo luogo, impostare la stringa valore di MyKey e l'intercettazione.

redis 127.0.0.1:6379> SET mykey "This is my test key"
OK
redis 127.0.0.1:6379> GETRANGE mykey 0 3
"This"
redis 127.0.0.1:6379> GETRANGE mykey 0 -1
"This is my test key"

stringa di Redis (stringa)