redis-cli --Run Redis command from Redis client
redis-cli is a Redis client for executing Redis commands. Install the Redis server and it will be installed automatically.
redis-cli
The Redis client starts.
Redis command
Run the Redis command.
PUBLISH running PUB
You can execute PUB by executing the PUBLISH command. PUB is used for push notifications.
PUBLISH channel name message
Both the channel name and the message are just strings. If you need complex data structures, use JSON for your messages.
Channel names are a global namespace for all processes, so consider non-overlapping names.
PUBLISH / foo / bar / baz? id = 5 Hello PUBLISH "/ foo / bar / baz? Id = 5" "Hello" PUBLISH "/ foo / bar / baz? id = 5"'{message: "Hello"}'
Both double and single quotes can be used to enclose the string.