Posts

Showing posts with the label Datatype

Redis Hash Datatype for .NET developers

Redis Hash Datatype are similar to Dictionary in C#. Redis Hash datatype is a mapping of key as string and value as a string. Redis hashes are memory optimized. var hashKey = “hashKey” ;    HashEntry [ ] redisMerchantDetails = {      new HashEntry ( “Name” , “Ravindra Naik” ) ,      new HashEntry ( “Age” , 26 ) ,      new HashEntry ( “Profession” , “Software Engineer” )    } ;    redis . HashSet ( hashKey , redisMerchantDetails ) ;    if ( redis . HashExists ( hashKey , “Age” ) )    {      var age = redis . HashGet ( hashKey , “Age” ) ; //Age is 26    }    var allHash = redis . HashGetAll ( hashKey ) ;    //get all the items    foreach ( var item in allHash )    {      //output      //key: Name, value:...