0

When storing the bin "{"india":False}" in aerospike it converts it to {"india":0} when storing. Is there a way to store booleans in Aerospike- since in strongly typed languages the above gives a type mismatch error.

Ajay Pal Singh
  • 682
  • 1
  • 5
  • 16

1 Answers1

1

Boolean type is not yet supported:

  1. Aerospike forum (Jan. 1, 2015): "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. As of Mar. 9, 2016, their changelog hasn't indicated added support for Boolean.

As for the type-mismatch problem, I simply declared TRUE and FALSE constants to handle it, for example:

static final long FALSE = 0L;
static final long TRUE = 1L;

// ...

if (result == TRUE) { 
    //Handle true case 
}
RavenMan
  • 1,807
  • 1
  • 15
  • 27
  • Most clients will serialize booleans, store them as bytes, and deserialize them into the boolean type. Do you mind stating which language client you're using? – Ronen Botzer Mar 20 '16 at 03:18
  • I've been using the Java asyncClient's `ExecuteListener`. When I call a UDF that returns false, I get 0 (type Long) – RavenMan Mar 21 '16 at 00:09