I want to set all entries in Hash. (SetAllEntriesToHash)
It must Clear all items in hash before running.
It is opposite of GetAllEntriesFromHash.
I want to set all entries in Hash. (SetAllEntriesToHash)
It must Clear all items in hash before running.
It is opposite of GetAllEntriesFromHash.
You have a couple options here.
1) You could let ServiceStack take care of this for you by using the high level Redis API.
This approach will disconnect you from having to deal directly with the hashing particulars. ServiceStack will figure out everything for you and stuff the object you send it into a hash automatically. If you want to update that object, just send it a new one with the same ID.
The flip-side of this is that you're giving up control of how your data is stored in Redis for an easier programming experience.
2) You handle all of the stuff yourself. There is no SetAllEntriesToHash function pre-built.
Alternatively, it may be easier just to delete and recreate the hash.
I would also like to draw your attention to RedisNativeClient. It allows you to run Redis commands that directly map to http://redis.io/commands.