Redis Functions


Redis allows building advanced caching mechanisms into Miva Script applications.

Miva Script Redis implementation uses the Hiredis library, which states: Hiredis only supports the binary-safe Redis protocol, so you can use it with any Redis version >= 1.2.0.

Redis Resources

View the Redis Library examples.

Name -- Syntax / Description
redis_connect
redis_connect( ip, port, conn_id var )
Connects to Redis on the specified IP / hostname and port.
Returns 1 on success, 0 on failure
  • ip / hostname = The IP address or hostname of the server Redis is on
  • port = The port number to connect on
  • conn_id = An output value containing an reference ID which is associated to the internal Redis connection.
redis_disconnect
redis_disconnect( conn_id )
Disconnects the specified instance from the Redis server
Returns 1 on success, 0 on failure
  • conn_id = The internal reference ID
redis_last_error
redis_last_error()
Gets the last error message resulting from a redis command.
Returns the last error message.
redis_append
redis_append( conn_id, key, value )
View documentation on redis.io: redis_append(...)
redis_auth
redis_auth( conn_id, password )
View documentation on redis.io: redis_auth(...)
redis_bgsave
redis_bgsave( conn_id )
View documentation on redis.io: redis_bgsave(...)
redis_bitcount
redis_bitcount( conn_id, key, options var )
View documentation on redis.io: redis_bitcount(...)
redis_bitfield
redis_bitfield( conn_id, key, options var, output var )
View documentation on redis.io: redis_bitfield(...)
redis_bitop
redis_bitop( conn_id, operation, destkey, key )
View documentation on redis.io: redis_bitop(...)
redis_bitpos
redis_bitpos( conn_id, key, bit, options var )
View documentation on redis.io: redis_bitpos(...)
redis_blpop
redis_blpop( conn_id, key, timeout, output var )
View documentation on redis.io: redis_blpop(...)
redis_brpop
redis_brpop( conn_id, key, timeout, output var )
View documentation on redis.io: redis_brpop(...)
redis_brpoplpush
redis_brpoplpush( conn_id, source, destination, timeout )
View documentation on redis.io: redis_brpoplpush(...)
redis_client_getname
redis_client_getname( conn_id )
View documentation on redis.io: redis_client_getname(...)
redis_client_kill
redis_client_kill( conn_id, options var )
View documentation on redis.io: redis_client_kill(...)
redis_client_list
redis_client_list( conn_id )
View documentation on redis.io: redis_client_list(...)
redis_client_pause
redis_client_pause( conn_id, timeout )
View documentation on redis.io: redis_client_pause(...)
redis_client_setname
redis_client_setname( conn_id, name )
View documentation on redis.io: redis_client_setname(...)
redis_command
redis_command( conn_id, output var )
View documentation on redis.io: redis_command(...)
redis_command_count
redis_command_count( conn_id )
View documentation on redis.io: redis_command_count(...)
redis_command_getkeys
redis_command_getkeys( conn_id, input var, output var )
View documentation on redis.io: redis_command_getkeys(...)
redis_command_info
redis_command_info( conn_id, command_name, output var )
View documentation on redis.io: redis_command_info(...)
redis_config_get
redis_config_get( conn_id, parameter, output var )
View documentation on redis.io: redis_config_get(...)
redis_config_resetstat
redis_config_resetstat( conn_id )
View documentation on redis.io: redis_config_resetstat(...)
redis_config_rewrite
redis_config_rewrite( conn_id )
View documentation on redis.io: redis_config_rewrite(...)
redis_config_set
redis_config_set( conn_id, parameter, value )
View documentation on redis.io: redis_config_set(...)
redis_dbsize
redis_dbsize( conn_id )
View documentation on redis.io: redis_dbsize(...)
redis_debug_object
redis_debug_object( conn_id, key )
View documentation on redis.io: redis_debug_object(...)
redis_debug_segfault
redis_debug_segfault( conn_id )
View documentation on redis.io: redis_debug_segfault(...)
redis_decr
redis_decr( conn_id, key )
View documentation on redis.io: redis_decr(...)
redis_decrby
redis_decrby( conn_id, key, decrement )
View documentation on redis.io: redis_decrby(...)
redis_del
redis_del( conn_id, key )
View documentation on redis.io: redis_del(...)
redis_discard
redis_discard( conn_id )
View documentation on redis.io: redis_discard(...)
redis_dump
redis_dump( conn_id, key )
View documentation on redis.io: redis_dump(...)
redis_echo
redis_echo( conn_id, message )
View documentation on redis.io: redis_echo(...)
redis_eval
redis_eval( conn_id, script, key, arg )
View documentation on redis.io: redis_eval(...)
redis_eval_array
redis_eval_array( conn_id, script, key, arg, output var )
View documentation on redis.io: redis_eval_array(...)
redis_evalsha
redis_evalsha( conn_id, sha1, key, arg )
View documentation on redis.io: redis_evalsha(...)
redis_evalsha_array
redis_evalsha_array( conn_id, sha1, key, arg, output var )
View documentation on redis.io: redis_evalsha_array(...)
redis_exec
redis_exec( conn_id, output var )
View documentation on redis.io: redis_exec(...)
redis_exists
redis_exists( conn_id, key )
View documentation on redis.io: redis_exists(...)
redis_expire
redis_expire( conn_id, key, seconds )
View documentation on redis.io: redis_expire(...)
redis_expireat
redis_expireat( conn_id, key, timestamp )
View documentation on redis.io: redis_expireat(...)
redis_flushall
redis_flushall( conn_id )
View documentation on redis.io: redis_flushall(...)
redis_flushdb
redis_flushdb( conn_id )
View documentation on redis.io: redis_flushdb(...)
redis_geoadd
redis_geoadd( conn_id, key, longitude, latitude, member )
View documentation on redis.io: redis_geoadd(...)
redis_geodist
redis_geodist( conn_id, key, member1, member2, options var )
View documentation on redis.io: redis_geodist(...)
redis_geohash
redis_geohash( conn_id, key, member, output var )
View documentation on redis.io: redis_geohash(...)
redis_geopos
redis_geopos( conn_id, key, member, output var )
View documentation on redis.io: redis_geopos(...)
redis_georadius
redis_georadius( conn_id, key, longitude, latitude, radius, unit, options var, output var )
View documentation on redis.io: redis_georadius(...)
redis_georadiusbymember
redis_georadiusbymember( conn_id, key, member, radius, unit, options var, output var )
View documentation on redis.io: redis_georadiusbymember(...)
redis_georadiusbymemberstore
redis_georadiusbymemberstore( conn_id, key, member, latitude, radius, unit, store_key )
View documentation on redis.io: redis_georadiusbymemberstore(...)
redis_georadiusbymemberstoredist
redis_georadiusbymemberstoredist( conn_id, key, member, latitude, radius, unit, storedist_key )
View documentation on redis.io: redis_georadiusbymemberstoredist(...)
redis_georadiusstore
redis_georadiusstore( conn_id, key, longitude, latitude, radius, unit, store_key, count )
View documentation on redis.io: redis_georadiusstore(...)
redis_georadiusstoredist
redis_georadiusstoredist( conn_id, key, longitude, latitude, radius, unit, storedist_key, count )
View documentation on redis.io: redis_georadiusstoredist(...)
redis_get
redis_get( conn_id, key )
View documentation on redis.io: redis_get(...)
redis_getbit
redis_getbit( conn_id, key, offset )
View documentation on redis.io: redis_getbit(...)
redis_getrange
redis_getrange( conn_id, key, start, end )
View documentation on redis.io: redis_getrange(...)
redis_getset
redis_getset( conn_id, key, value )
View documentation on redis.io: redis_getset(...)
redis_hdel
redis_hdel( conn_id, key, field )
View documentation on redis.io: redis_hdel(...)
redis_hexists
redis_hexists( conn_id, key, field )
View documentation on redis.io: redis_hexists(...)
redis_hget
redis_hget( conn_id, key, field )
View documentation on redis.io: redis_hget(...)
redis_hgetall
redis_hgetall( conn_id, key, output var )
View documentation on redis.io: redis_hgetall(...)
redis_hincrby
redis_hincrby( conn_id, key, field, increment )
View documentation on redis.io: redis_hincrby(...)
redis_hincrbyfloat
redis_hincrbyfloat( conn_id, key, field, increment )
View documentation on redis.io: redis_hincrbyfloat(...)
redis_hkeys
redis_hkeys( conn_id, key, output var )
View documentation on redis.io: redis_hkeys(...)
redis_hlen
redis_hlen( conn_id, key )
View documentation on redis.io: redis_hlen(...)
redis_hmget
redis_hmget( conn_id, key, field, output var )
View documentation on redis.io: redis_hmget(...)
redis_hmset
redis_hmset( conn_id, key, field, value )
View documentation on redis.io: redis_hmset(...)
redis_hscan
redis_hscan( conn_id, key, cursor, options var, output var )
View documentation on redis.io: redis_hscan(...)
redis_hset
redis_hset( conn_id, key, field, value )
View documentation on redis.io: redis_hset(...)
redis_hsetnx
redis_hsetnx( conn_id, key, field, value )
View documentation on redis.io: redis_hsetnx(...)
redis_hstrlen
redis_hstrlen( conn_id, key, field )
View documentation on redis.io: redis_hstrlen(...)
redis_hvals
redis_hvals( conn_id, key, output var )
View documentation on redis.io: redis_hvals(...)
redis_incr
redis_incr( conn_id, key )
View documentation on redis.io: redis_incr(...)
redis_incrby
redis_incrby( conn_id, key, increment )
View documentation on redis.io: redis_incrby(...)
redis_incrbyfloat
redis_incrbyfloat( conn_id, key, increment )
View documentation on redis.io: redis_incrbyfloat(...)
redis_info
redis_info( conn_id )
View documentation on redis.io: redis_info(...)
redis_info_section
redis_info_section( conn_id, section )
View documentation on redis.io: redis_info_section(...)
redis_keys
redis_keys( conn_id, pattern, output var )
View documentation on redis.io: redis_keys(...)
redis_lastsave
redis_lastsave( conn_id )
View documentation on redis.io: redis_lastsave(...)
redis_lindex
redis_lindex( conn_id, key, index )
View documentation on redis.io: redis_lindex(...)
redis_linsert_after
redis_linsert_after( conn_id, key, pivot, value )
View documentation on redis.io: redis_linsert_after(...)
redis_linsert_before
redis_linsert_before( conn_id, key, pivot, value )
View documentation on redis.io: redis_linsert_before(...)
redis_llen
redis_llen( conn_id, key )
View documentation on redis.io: redis_llen(...)
redis_lpop
redis_lpop( conn_id, key )
View documentation on redis.io: redis_lpop(...)
redis_lpush
redis_lpush( conn_id, key, value )
View documentation on redis.io: redis_lpush(...)
redis_lpushx
redis_lpushx( conn_id, key, value )
View documentation on redis.io: redis_lpushx(...)
redis_lrange
redis_lrange( conn_id, key, start, stop, output var )
View documentation on redis.io: redis_lrange(...)
redis_lrem
redis_lrem( conn_id, key, count, value )
View documentation on redis.io: redis_lrem(...)
redis_lset
redis_lset( conn_id, key, index, value )
View documentation on redis.io: redis_lset(...)
redis_ltrim
redis_ltrim( conn_id, key, start, stop )
View documentation on redis.io: redis_ltrim(...)
redis_mget
redis_mget( conn_id, key, output var )
View documentation on redis.io: redis_mget(...)
redis_migrate
redis_migrate( conn_id, host, port, key, destination_db, timeout, options var )
View documentation on redis.io: redis_migrate(...)
redis_move
redis_move( conn_id, key, db )
View documentation on redis.io: redis_move(...)
redis_mset
redis_mset( conn_id, key, value )
View documentation on redis.io: redis_mset(...)
redis_msetnx
redis_msetnx( conn_id, key, value )
View documentation on redis.io: redis_msetnx(...)
redis_multi
redis_multi( conn_id )
View documentation on redis.io: redis_multi(...)
redis_object_encoding
redis_object_encoding( conn_id, key )
View documentation on redis.io: redis_object_encoding(...)
redis_object_idletime
redis_object_idletime( conn_id, key )
View documentation on redis.io: redis_object_idletime(...)
redis_object_refcount
redis_object_refcount( conn_id, key )
View documentation on redis.io: redis_object_refcount(...)
redis_persist
redis_persist( conn_id, key )
View documentation on redis.io: redis_persist(...)
redis_pexpire
redis_pexpire( conn_id, key, milliseconds )
View documentation on redis.io: redis_pexpire(...)
redis_pexpireat
redis_pexpireat( conn_id, key, milliseconds_timestamp )
View documentation on redis.io: redis_pexpireat(...)
redis_pfadd
redis_pfadd( conn_id, key, element )
View documentation on redis.io: redis_pfadd(...)
redis_pfcount
redis_pfcount( conn_id, key )
View documentation on redis.io: redis_pfcount(...)
redis_pfmerge
redis_pfmerge( conn_id, destkey, sourcekey )
View documentation on redis.io: redis_pfmerge(...)
redis_ping
redis_ping( conn_id )
View documentation on redis.io: redis_ping(...)
redis_ping_message
redis_ping_message( conn_id, message )
View documentation on redis.io: redis_ping_message(...)
redis_pttl
redis_pttl( conn_id, key )
View documentation on redis.io: redis_pttl(...)
redis_quit
redis_quit( conn_id )
View documentation on redis.io: redis_quit(...)
redis_randomkey
redis_randomkey( conn_id )
View documentation on redis.io: redis_randomkey(...)
redis_rename
redis_rename( conn_id, key, newkey )
View documentation on redis.io: redis_rename(...)
redis_renamenx
redis_renamenx( conn_id, key, newkey )
View documentation on redis.io: redis_renamenx(...)
redis_restore
redis_restore( conn_id, key, ttl, serialized_value, options var )
View documentation on redis.io: redis_restore(...)
redis_role
redis_role( conn_id, output var )
View documentation on redis.io: redis_role(...)
redis_rpop
redis_rpop( conn_id, key )
View documentation on redis.io: redis_rpop(...)
redis_rpoplpush
redis_rpoplpush( conn_id, source, destination )
View documentation on redis.io: redis_rpoplpush(...)
redis_rpush
redis_rpush( conn_id, key, value )
View documentation on redis.io: redis_rpush(...)
redis_rpushx
redis_rpushx( conn_id, key, value )
View documentation on redis.io: redis_rpushx(...)
redis_sadd
redis_sadd( conn_id, key, member )
View documentation on redis.io: redis_sadd(...)
redis_save
redis_save( conn_id )
View documentation on redis.io: redis_save(...)
redis_scan
redis_scan( conn_id, cursor, options var, output var )
View documentation on redis.io: redis_scan(...)
redis_scard
redis_scard( conn_id, key )
View documentation on redis.io: redis_scard(...)
redis_script_exists
redis_script_exists( conn_id, sha1, output var )
View documentation on redis.io: redis_script_exists(...)
redis_script_flush
redis_script_flush( conn_id )
View documentation on redis.io: redis_script_flush(...)
redis_script_kill
redis_script_kill( conn_id )
View documentation on redis.io: redis_script_kill(...)
redis_script_load
redis_script_load( conn_id, script )
View documentation on redis.io: redis_script_load(...)
redis_sdiff
redis_sdiff( conn_id, key, output var )
View documentation on redis.io: redis_sdiff(...)
redis_sdiffstore
redis_sdiffstore( conn_id, destination, key )
View documentation on redis.io: redis_sdiffstore(...)
redis_select
redis_select( conn_id, index )
View documentation on redis.io: redis_select(...)
redis_set
redis_set( conn_id, key, value, options var )
View documentation on redis.io: redis_set(...)
redis_setbit
redis_setbit( conn_id, key, offset, value )
View documentation on redis.io: redis_setbit(...)
redis_setrange
redis_setrange( conn_id, key, offset, value )
View documentation on redis.io: redis_setrange(...)
redis_shutdown
redis_shutdown( conn_id )
View documentation on redis.io: redis_shutdown(...)
redis_shutdown_nosave
redis_shutdown_nosave( conn_id )
View documentation on redis.io: redis_shutdown_nosave(...)
redis_shutdown_save
redis_shutdown_save( conn_id )
View documentation on redis.io: redis_shutdown_save(...)
redis_sinter
redis_sinter( conn_id, key, output var )
View documentation on redis.io: redis_sinter(...)
redis_sinterstore
redis_sinterstore( conn_id, destination, key )
View documentation on redis.io: redis_sinterstore(...)
redis_sismember
redis_sismember( conn_id, key, member )
View documentation on redis.io: redis_sismember(...)
redis_slowlog_get
redis_slowlog_get( conn_id, output var )
View documentation on redis.io: redis_slowlog_get(...)
redis_slowlog_get_count
redis_slowlog_get_count( conn_id, count, output var )
View documentation on redis.io: redis_slowlog_get_count(...)
redis_slowlog_len
redis_slowlog_len( conn_id )
View documentation on redis.io: redis_slowlog_len(...)
redis_slowlog_reset
redis_slowlog_reset( conn_id )
View documentation on redis.io: redis_slowlog_reset(...)
redis_smembers
redis_smembers( conn_id, key, output var )
View documentation on redis.io: redis_smembers(...)
redis_smove
redis_smove( conn_id, source, destination, member )
View documentation on redis.io: redis_smove(...)
redis_sort
redis_sort( conn_id, key, options var, output var )
View documentation on redis.io: redis_sort(...)
redis_sortstore
redis_sortstore( conn_id, key, destination, options var )
View documentation on redis.io: redis_sortstore(...)
redis_spop
redis_spop( conn_id, key )
View documentation on redis.io: redis_spop(...)
redis_spop_count
redis_spop_count( conn_id, key, count, output var )
View documentation on redis.io: redis_spop_count(...)
redis_srandmember
redis_srandmember( conn_id, key )
View documentation on redis.io: redis_srandmember(...)
redis_srandmember_count
redis_srandmember_count( conn_id, key, count, output var )
View documentation on redis.io: redis_srandmember_count(...)
redis_srem
redis_srem( conn_id, key, member )
View documentation on redis.io: redis_srem(...)
redis_sscan
redis_sscan( conn_id, key, cursor, options var, output var )
View documentation on redis.io: redis_sscan(...)
redis_strlen
redis_strlen( conn_id, key )
View documentation on redis.io: redis_strlen(...)
redis_sunion
redis_sunion( conn_id, key, output var )
View documentation on redis.io: redis_sunion(...)
redis_sunionstore
redis_sunionstore( conn_id, destination, key )
View documentation on redis.io: redis_sunionstore(...)
redis_time
redis_time( conn_id, output var )
View documentation on redis.io: redis_time(...)
redis_touch
redis_touch( conn_id, key )
View documentation on redis.io: redis_touch(...)
redis_ttl
redis_ttl( conn_id, key )
View documentation on redis.io: redis_ttl(...)
redis_type
redis_type( conn_id, key )
View documentation on redis.io: redis_type(...)
redis_unwatch
redis_unwatch( conn_id )
View documentation on redis.io: redis_unwatch(...)
redis_watch
redis_watch( conn_id, key )
View documentation on redis.io: redis_watch(...)
redis_zadd
redis_zadd( conn_id, key, score, member, options var )
View documentation on redis.io: redis_zadd(...)
redis_zcard
redis_zcard( conn_id, key )
View documentation on redis.io: redis_zcard(...)
redis_zcount
redis_zcount( conn_id, key, min, max )
View documentation on redis.io: redis_zcount(...)
redis_zincrby
redis_zincrby( conn_id, key, increment, member )
View documentation on redis.io: redis_zincrby(...)
redis_zinterstore
redis_zinterstore( conn_id, destination, key, options var )
View documentation on redis.io: redis_zinterstore(...)
redis_zlexcount
redis_zlexcount( conn_id, key, min, max )
View documentation on redis.io: redis_zlexcount(...)
redis_zrange
redis_zrange( conn_id, key, start, stop, options var, output var )
View documentation on redis.io: redis_zrange(...)
redis_zrangebylex
redis_zrangebylex( conn_id, key, min, max, options var, output var )
View documentation on redis.io: redis_zrangebylex(...)
redis_zrangebyscore
redis_zrangebyscore( conn_id, key, min, max, options var, output var )
View documentation on redis.io: redis_zrangebyscore(...)
redis_zrank
redis_zrank( conn_id, key, member )
View documentation on redis.io: redis_zrank(...)
redis_zrem
redis_zrem( conn_id, key, member )
View documentation on redis.io: redis_zrem(...)
redis_zremrangebylex
redis_zremrangebylex( conn_id, key, min, max )
View documentation on redis.io: redis_zremrangebylex(...)
redis_zremrangebyrank
redis_zremrangebyrank( conn_id, key, start, stop )
View documentation on redis.io: redis_zremrangebyrank(...)
redis_zremrangebyscore
redis_zremrangebyscore( conn_id, key, min, max )
View documentation on redis.io: redis_zremrangebyscore(...)
redis_zrevrange
redis_zrevrange( conn_id, key, start, stop, options var, output var )
View documentation on redis.io: redis_zrevrange(...)
redis_zrevrangebylex
redis_zrevrangebylex( conn_id, key, max, min, options var, output var )
View documentation on redis.io: redis_zrevrangebylex(...)
redis_zrevrangebyscore
redis_zrevrangebyscore( conn_id, key, max, min, optoins var, output var )
View documentation on redis.io: redis_zrevrangebyscore(...)
redis_zrevrank
redis_zrevrank( conn_id, key, member )
View documentation on redis.io: redis_zrevrank(...)
redis_zscan
redis_zscan( conn_id, key, cursor, options var, output var )
View documentation on redis.io: redis_zscan(...)
redis_zscore
redis_zscore( conn_id, key, member )
View documentation on redis.io: redis_zscore(...)
redis_zunionstore
redis_zunionstore( conn_id, destination, key, options var )
View documentation on redis.io: redis_zunionstore(...)
User Annotations: redis_func