# READWRITE

> Turn off READONLY for the connection, so that reads on a replica are redirected again.

URL: https://docs.hotkv.com/commands/readwrite/

```
READWRITE
```

- Group: Cluster
- Complexity: O(1)
- HotKV Cloud: all plans
- On-Premise: no license needed

`READWRITE` undoes [READONLY](https://docs.hotkv.com/commands/readonly/index.md) for the current
connection. Afterwards a replica answers every command on a key with `-MOVED`
to its primary again, which is the default for a new connection.

## Return value

Simple string `OK` in RESP2 and RESP3. With cluster mode off:
`ERR This instance has cluster support disabled`.

## Examples

```
10.0.0.4:6379> READONLY
OK
10.0.0.4:6379> GET user:1000
"alice"
10.0.0.4:6379> READWRITE
OK
10.0.0.4:6379> GET user:1000
(error) MOVED 1649 10.0.0.1:6379
```

## Compatibility

Same as Redis 7 and Valkey 8.

## See also

[READONLY](https://docs.hotkv.com/commands/readonly/index.md), [ASKING](https://docs.hotkv.com/commands/asking/index.md)

In a cluster: [Keys, slots and commands in a cluster](https://docs.hotkv.com/clustering/keys-and-commands/index.md#reading-from-replicas)