Want to increment bins value


#1

Hi, I want to increment bins value its in integer format, I tried below one but it doesn’t work for me. I am suing community edition server

cl_object key_obj;
citrusleaf_object_init_int(&key_obj, 5);
uint gen_count;
cl_operation ops[1];
ops[0].op = CL_OP_INCR;
strcpy(ops[0].bin.bin_name, "test_bin_one");
citrusleaf_object_init_int(&values[0].object, 5);
citrusleaf_operate(c->asc, c->ns, c->set, &o_key, ops, 1, 0, 0, &gen_count) ; 

above code does not work for me please give me some suitable example.

Thanks, Ravi


#2

In line 7 and 8 of your code, you make reference to “values[0]” and “o_key”. They should contain the following:

citrusleaf_object_init_int(&ops[0].bin.object, 5);
citrusleaf_operate(c->asc, c->ns, c->set, &key_obj, ops, 1, 0, 0, &gen_count) ;

Please let us know if this does not work.