Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSetAsync Set for one Property to null #347

Open
kurtisane opened this issue Nov 14, 2024 · 1 comment
Open

MSetAsync Set for one Property to null #347

kurtisane opened this issue Nov 14, 2024 · 1 comment
Assignees
Labels
waiting-for-feedback We need additional information before we can continue

Comments

@kurtisane
Copy link

Thanks for reporting an issue in NRedisStack! Please update the appropriate text below, as much data as possible really helps!

NRedisStack Version: 0.13.0

Redis Stack Version: 7.4.0-v1

Description:

When using MSetAsync and passing multiple KeyPathValues to it I can not pass in one KeyPathValue with null as value.
I have a fix for this. I need to basically map null to "null", but this is inconsistend with the Set Command.

That one does not accept "null" but only null.

This array:
image

Leads to this exception:
StackExchange.Redis.RedisServerException: expected value at line 1 column 1
at NRedisStack.Auxiliary.ExecuteAsync(IDatabaseAsync db, SerializedCommand command)
at NRedisStack.JsonCommandsAsync.MSetAsync(KeyPathValue[] KeyPathValueList)

@atakavci
Copy link
Collaborator

atakavci commented Nov 15, 2024

hi @kurtisane , thank you for using NRedisStack and letting us about the case your are experiencing.
i was trying to reproduce the case with null values, yet not successful..

could you check if this exception shows up even when you drop the string value at index 0 in screenshot (the one starts with 2UZb_.....).
i believe the issue is due to misuse of value field KeyPathValue type for string values.
if that is the case, could you try to do something like below to handle the case for strings;

        values = new[]
             {
            new KeyPathValue("key1", "$.textField1", "\"someText\""),
            new KeyPathValue("key1", "$.textField2",  JsonValue.Create("someText")),
            new KeyPathValue("key1", "$.textField3", null),
        }; 

@atakavci atakavci self-assigned this Nov 18, 2024
@atakavci atakavci added the waiting-for-feedback We need additional information before we can continue label Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-feedback We need additional information before we can continue
Projects
None yet
Development

No branches or pull requests

2 participants