Aerospike转换"真/假"布尔值为0/1

时间:2016-03-09 14:02:14

标签: aerospike

存储垃圾箱" {" india":False}"在airospike中,它在存储时将其转换为{" india":0}。有没有办法在Aerospike中存储布尔值 - 因为在强类型语言中,上面给出了类型不匹配错误。

1 个答案:

答案 0 :(得分:1)

尚不支持布尔类型:

  1. Aerospike论坛(2015年1月1日):"Boolean is not on our short list (float is), but we are currently adding a few other types as well. We will consider boolean."

  2. 截至2016年3月9日,他们changelog尚未表示支持布尔。

  3. 至于类型不匹配问题,我只是声明TRUE和FALSE常量来处理它,例如:

    static final long FALSE = 0L;
    static final long TRUE = 1L;
    
    // ...
    
    if (result == TRUE) { 
        //Handle true case 
    }