Delete List of the Redis

List of Redis commands in unfounded index remove elements of command, but sometimes business will need this feature.

Earlier on the instruction:

LSET ListKey index "__deleted__"
LREM ListKey 0 "__deleted__"

Pipe with the transaction may be combined into one request

MULTI
LSET ListKey index "__deleted__"
LREM ListKey 0 "__deleted__"
EXEC

 

First with the index value is set to be deleted LSET command to delete a specific identity, re-use LREM command has to remove elements identified deleted.

Further discussion display, built directly Redis is no reason why this command is to be considered as two or more end LREM distributed where simultaneous transmission request, index but may be a plurality deleted. LSET will only overwrite the value of the same index. Unable to secure atomic operation to achieve it.

Guess you like

Origin www.cnblogs.com/findbetterme/p/11453996.html