For set : SET key value [EX seconds|PX milliseconds] [NX|XX] [KEEPTTL] [GET]

does it mean we hv to do

set key value ex 123 xx keepttl get <- is this the command? or set key value ex 123 get <- this will suffice?

how to use the redis as "standard compliant"? I'm writing a redis connector would like to understand how to write it properly.

Comment From: oranagra

I don't think I understand your problem or question. Anything in rectangular brackets (I.e. []) is optional. and | denotes mutually exclusive (I.e. You can use one but not both). This is a standard notation. Also the docs (https://redis.io/commands/set) have a box in which you can actually try typing commands and see what works. and Btw, you can make PRs to suggest changes https://github.com/redis/redis-doc/pulls

Comment From: hiqsociety

set abc 123 ex 321 nx get ERR ERR syntax error

is this correct syntaxically??

Comment From: sundb

@hiqsociety nx and get are in conflict, we cannot get the old value in a case where it does not exist, but the documentation really doesn't show this conflict. I feel like this is the second time I've seen someone ask this question.

Comment From: hiqsociety

what else is in conflict?

possible to show the lines where this function is?

Comment From: sundb

https://github.com/redis/redis/blob/501d7755831527b4237f9ed6050ec84203934e4d/src/t_string.c#L191