redis-om-dotnet icon indicating copy to clipboard operation
redis-om-dotnet copied to clipboard

JSON.SET with NX/XX

Open iozcelik opened this issue 3 years ago • 4 comments

Normally Redis has support to JSON.SET key path value [NX | XX] command.

I think this have to implement the dotnet library. We use raw command now but it is not best approach. InsertIfNotExist or InsertIfExist native support will be good. This result could return bool.

true if executed correctly, or false if the specified NX or XX conditions were not met.

Conditions NX - only set the key if it does not already exist XX - only set the key if it already exists

iozcelik avatar Sep 19 '22 17:09 iozcelik

I will work on it soon.

shacharPash avatar Sep 20 '22 06:09 shacharPash

@shacharPash Not sure if it is possible, can we also add: AddorUpdate ? this would be great since it would take care of all the checks

zulander1 avatar Sep 22 '22 18:09 zulander1

@shacharPash Not sure if it is possible, can we also add: AddorUpdate ? this would be great since it would take care of all the checks

Wouldn't AddOrUpdate() effectively be the same as an Insert()... or are you think of this more for the statefull side where it would replace or patch on the request?

VagyokC4 avatar Sep 23 '22 03:09 VagyokC4

No, i've created https://github.com/redis/redis-om-dotnet/issues/212

zulander1 avatar Sep 23 '22 14:09 zulander1