cout<<endl<<"Enter the name: ";
string pk;
getline(cin>>ws,pk);
as_key_init(&key, "test", "vishal_set", pk.c_str());
cout<<endl<<"Enter the age: ";
int age;
cin>>age;
as_record_set_int64(&rec, "age", age);
cout<<endl<<"Enter the contact no: ";
string contact_no;
getline(cin>>ws,contact_no);
as_record_set_str(&rec, "contact_no", contact_no.c_str());
as_arraylist list;
as_arraylist_inita(&list,3);
as_arraylist_append_str (&list, "playing football");
as_arraylist_append_str (&list, "playing cricket");
as_arraylist_append_str(&list,"playing badminton");
if(!(as_record_set_list(&rec, "hobbies", (as_list *)&list)))
{
printf("\n[%s::%d]Error\n",__FILE__,__LINE__);
}
if (aerospike_key_put(&as, &err,NULL, &key, &rec) != AEROSPIKE_OK)
{
printf("error(%d) %s at [%s:%d]", err.code, err.message, err.file, err.line);
}
age and contact_no are getting added to the record(I can see them in aql), however, ‘as_record_set_list(&rec, “hobbies”, (as_list *)&list)’ is returning false. Please help.