Hiredis Strings

Redis Developer Course Redis Technical Support Redis Enterprise Server

Strings

입력 방법

  • 키, 값 직접 입력: reply = redisCommand(context, "SET key value");
  • %s 사용 1: reply = redisCommand(context, "SET %s %s", "key", "value");
  • %s 사용 2: reply = redisCommand(context, "SET key:%s %s", "user", "value");
  • %b(바이너리) 사용: reply = redisCommand(context, "SET key %b", value, (size_t) valuelen);
  • 숫자(int, long, float)일 때는 %d, %i, %l, %f 등을 사용한다. Int를 %s로 저장(SET)하면 Core dump가 발생한다. GET해서 printf로 볼 때는 저장시 사용한 format과 상관없이 %s를 사용한다. 저장시 format을 사용하는 것은 string으로 바꾸는 것을 의미한다.

SET

DEL

GET

INCR

DECR

INCRBY

DECRBY

INCRBYFLOAT

SETNX

SETEX

PSETEX

MSET

MGET

MSETNX

APPEND

STRLEN

SETRANGE

GETRANGE

GETSET


SETBIT

GETBIT

BITOP

BITCOUNT

BITPOS



<< Hiredis Connection Strings Lists >>

Email 답글이 올라오면 이메일로 알려드리겠습니다.