1

I like to get the members of a set, NUL-separated. What do I do?

redis-cli SMEMBERS theset

Uses the newline delimiter.

HappyFace
  • 3,439
  • 2
  • 24
  • 43

1 Answers1

0

I am using python as a workaround:

#!/usr/bin/env python3

import sys
import redis
r = redis.StrictRedis(host='localhost', port=6379, db=0)

first = True
for mem in r.smembers(sys.argv[1]):
    if not first:
        sys.stdout.buffer.write(b"\0")

    sys.stdout.buffer.write(mem)
    first = False
HappyFace
  • 3,439
  • 2
  • 24
  • 43