Optional
autoOptional
autoAfter reconnected, if the previous connection was in the subscriber mode, client will auto re-subscribe these channels. default: true.
Optional
commandThe milliseconds before a timeout occurs when executing a single command. By default, there is no timeout and the client will wait indefinitely. The timeout is enforced only on the client side, not server side. The server may still complete the operation after a timeout error occurs on the client side.
Optional
connectThe milliseconds before a timeout occurs during the initial connection to the Redis server. default: 10000.
Optional
connectionOptional
dbDatabase index to use.
Optional
disconnectThe milliseconds before socket.destroy() is called after socket.end() if the connection remains half-open during disconnection. default: 2000
Optional
dropIf you are using the hiredis parser, it's highly recommended to enable this option. Create another instance with dropBufferSupport disabled for other commands that you want to return binary instead of string
Optional
enableWhen enabled, all commands issued during an event loop iteration are automatically wrapped in a pipeline and sent to the server at the same time. This can improve performance by 30-50%. default: false.
Optional
enableBy default, if there is no active connection to the Redis server, commands are added to a queue and are executed once the connection is "ready" (when enableReadyCheck is true, "ready" means the Redis server has loaded the database from disk, otherwise means the connection to the Redis server has been established). If this option is false, when execute the command when the connection isn't ready, an error will be returned.
Optional
enableWhen a connection is established to the Redis server, the server might still be loading the database from disk. While loading, the server not respond to any commands. To work around this, when this option is true, ioredis will check the status of the Redis server, and when the Redis server is able to process commands, a ready event will be emitted.
Optional
enableTLSForWhether to support the tls
option when connecting to Redis via sentinel mode.
default: false.
Optional
family4 (IPv4) or 6 (IPv6), Defaults to 4.
Optional
hostOptional
keepTCP KeepAlive on the socket with a X ms delay before start. Set to a non-number value to disable keepAlive.
Optional
keyOptional
lazyOptional
maxBy default, all pending commands will be flushed with an error every
20 retry attempts. That makes sure commands won't wait forever when
the connection is down. You can change this behavior by setting
maxRetriesPerRequest
.
Set maxRetriesPerRequest to null
to disable this behavior, and
every command will wait forever until the connection is alive again
(which is the default behavior before ioredis v4).
Optional
maxDefault script definition caching time.
Optional
namedefault: null.
Optional
natNAT map for sentinel connector. default: null.
Optional
noWhether to disable the Nagle's Algorithm.
Optional
passwordIf set, client will send AUTH command with the value of this option when connected.
Optional
pathLocal domain socket path. If set the port, host and family will be ignored.
Optional
portOptional
preferredCan be used to prefer a particular slave or set of slaves based on priority.
Optional
readEnable READONLY mode for the connection. Only available for cluster mode. default: false.
Optional
roledefault: "master".
Optional
sentinelOptional
sentinelTLSOptional
sentinelOptional
sentinelsOptional
showWhether to show a friendly error stack. Will decrease the performance significantly.
Optional
stringForce numbers to be always returned as JavaScript strings. This option is necessary when dealing with big numbers (exceed the [-2^53, +2^53] range).
Optional
tlsOptional
updateUpdate the given sentinels
list with new IP addresses when communicating with existing sentinels.
default: true.
Optional
usernameIf set, client will send AUTH command with the value of this option as the first argument when connected. The password
option must be set too. Username should only be set for Redis >=6.
Optional
reconnectOptional
retryWhen the return value isn't a number, ioredis will stop trying to reconnect. Fixed in: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/15858
Optional
sentinel
If true, client will resend unfulfilled commands(e.g. block commands) in the previous connection when reconnected. default: true.