3

I wonder is there any method to completely delete a set in the StackExchange.Redis library?

As I know there is a method in Redis : Empty/delete a set in Redis?

Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
AminSojoudi
  • 1,904
  • 2
  • 18
  • 42
  • `"is there any method to completely delete a Set..."` -- You literally linked to a question that tells you to use [`DEL`](https://redis.io/commands/del). What are you actually asking then because I do not understand your issue. – maccettura Jun 26 '18 at 18:43
  • I want a method in `StackExchange.Redis` library not a command in Redis. – AminSojoudi Jun 26 '18 at 20:42
  • 1
    I believe you want `KeyDelete`. As seen in the [github repo](https://github.com/StackExchange/StackExchange.Redis/blob/0542bc9c34a5685fef17d74e567deb216db71390/StackExchange.Redis/StackExchange/Redis/Interfaces/IDatabase.cs) the comments for this method indicate its the same as [DEL](https://redis.io/commands/del) – maccettura Jun 26 '18 at 20:47
  • `KeyDelete` just deletes a single Key/Value, I want to delete a `Set` with all keys inside it. – AminSojoudi Jun 26 '18 at 21:42
  • 1
    Have you tried it? Based on the question you linked ‘DEL setName’ should work. I know the documentation says “Key” but the docs also say this is equivalent to DEL – maccettura Jun 27 '18 at 04:13
  • @maccettura It worked, – AminSojoudi Jul 14 '18 at 14:15
  • awesome. Glad to hear! I’m going to add the solution as an answer in case anyone else runs into this – maccettura Jul 14 '18 at 14:27

1 Answers1

3

The KeyDelete method should be what you’re looking for. As seen in the repo the comments indicate it functions the same as DEL

maccettura
  • 10,514
  • 3
  • 28
  • 35