StackExchange.Redis.Extensions icon indicating copy to clipboard operation
StackExchange.Redis.Extensions copied to clipboard

Strange behaviour on SetRemoveAsync

Open lbusuttil opened this issue 4 years ago • 0 comments

Describe the bug When I monitor redis using redis-cli monitor I can see that SREM is adding " to the start and end of member

To Reproduce I have a set in redis and I am getting the members as follows:

RedisValue[] Items = await _redis.GetDb(14).Database.SetMembersAsync("$DemoSet");

I am then iterating the array as follows:

foreach (RedisValue key in Items) { string itm = key.ToString(); await _redis.GetDb(14).SetRemoveAsync("$DemoSet", key, CommandFlags.FireAndForget); //statement 1 await _redis.GetDb(14).SetRemoveAsync("$DemoSet", itm, CommandFlags.FireAndForget); //statement 2 }

for both statements I am seeing SREM "$DemoSet" ""amember"" This is causing the member not to be found and hence not removed.

Expected behavior A clear and concise description of what you expected to happen.

I should see SREM "$DemoSet" "amember"

Screenshots / StackTrace If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Redis is installed on Ubunut whilst my code is running on Windows 10
  • Runtime netcoreapp3.1
  • Version [e.g. 6.0.0]

Additional context <PackageReference Include="StackExchange.Redis" Version="2.2.4" /> <PackageReference Include="StackExchange.Redis.Extensions.Core" Version="6.4.5" /> <PackageReference Include="StackExchange.Redis.Extensions.Newtonsoft" Version="6.4.5" />

lbusuttil avatar Mar 12 '21 07:03 lbusuttil