Given below are some lines of code that I’ve taken from examples provided on github. I’m getting the error code “AEROSPIKE_ERR_ENTERPRISE_ONLY”. I don’t see which enterprise operation I’m using here:
as_key rkey;
as_key_init_int64(&rkey,"test", "test_nested_map", 17);
as_hashmap m1;
as_hashmap_init(&m1, 2);
as_string k11;
as_string_init(&k11,(char*) "key11", false);
as_integer v11;
as_integer_init(&v11, 9);
as_hashmap_set(&m1, (as_val*)&k11, (as_val*)&v11);
as_string k12;
as_string_init(&k12,(char*) "key12", false);
as_integer v12;
as_integer_init(&v12, 4);
as_hashmap_set(&m1, (as_val*)&k12, (as_val*)&v12);
as_hashmap m2;
as_hashmap_init(&m2, 2);
as_string k21;
as_string_init(&k21,(char *) "key21", false);
as_integer v21;
as_integer_init(&v21, 3);
as_hashmap_set(&m2, (as_val*)&k21, (as_val*)&v21);
as_string k22;
as_string_init(&k22,(char *) "key22", false);
as_integer v22;
as_integer_init(&v22, 5);
as_hashmap_set(&m2, (as_val*)&k22, (as_val*)&v22);
as_hashmap map;
as_hashmap_init(&map, 2);
as_string k1;
as_string_init(&k1,(char*) "key1", false);
as_hashmap_set(&map, (as_val*)&k1, (as_val*)&m1);
as_string k2;
as_string_init(&k2,(char *) "key2", false);
as_hashmap_set(&map, (as_val*)&k2, (as_val*)&m2);
as_record rec;
as_record_inita(&rec, 1);
as_record_set_map(&rec,(char *) "newBin", (as_map*)&map);
as_error err;
as_status status = aerospike_key_put(DbInstance(), &err, NULL, &rkey, &rec);
if(status != AEROSPIKE_OK)
{
printf("\n[%s::%d]Error [%d] , Error_Msg-->%s-- \n",__FILE__,__LINE__,err.code, err.message);
as_record_destroy(&rec);
return -1;
}
else
{
printf("\n[%s::%d] Success\n",__FILE__,__LINE__);
as_record_destroy(&rec);
}