assert redis.hsetnx("myhash", "field1", "Hello") == True assert redis.hsetnx("myhash", "field1", "World") == False
Write a field to a hash but only if the field does not exist.
True
False
Was this page helpful?