[OpenSIPS-Users] redis HMGET nil value problem

Vlad Paiu vladpaiu at opensips.org
Thu May 28 15:28:11 CEST 2015


Hello,

Currently, only STRING and INTEGER data types are supported - no NULL 
support in the cachedb raw interface.

Please open a GITHUB issue for this and will fix it as soon as possible.

Best Regards,

Vlad Paiu
OpenSIPS Developer
http://www.opensips-solutions.com

On 28.05.2015 16:21, Jayesh Nambiar wrote:
> Hi,
> I'm using cache_raw queries to get data from redis and I have a 
> problem with accessing nil values that gets returned from it.
> For eg I do the following:
> cache_raw_query("redis:myRedis HMGET one two three", "$avp(result)");
>
> Here the value of one is abc, two is not present in redis and three is 
> xyz. Now if I access the values, I ideally expect it to be the following:
> $(avp(result)[0]) = xyz, $(avp(result)[1]) = <null> and 
> $(avp(result)[2]) = abc.
> But since key two is not present in redis for whatever reasons, the 
> result I get back is:
> $(avp(result)[0]) = xyz
> $(avp(result)[1]) = abc
> $(avp(result)[2]) = <null>
>
> This actually makes my value matching go for a toss. Is there a better 
> solution to access the array that is returned back from redis or at 
> least store the value as NULL in that array element of avp. Any help 
> is greatly appreciated.
>
> Thanks,
>
> - Jayesh
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150528/a820e90b/attachment.htm>


More information about the Users mailing list