Record return type


UDF is a nice feature and works really well and easy to you. Thank you.

I have this question, A Record UDF can return a single value of any of the types supported by the database: integer, string, bytes, list and map.

So in simple words we cannot return record (which is returned by get api or first param to UDF), we have to return the bin values e.g. list { rec[‘bin1’], rec[‘bin2’] }



There is subtle difference. Record is not a data type in aerospike. So the preferred and recommended way to work with record to move it back and forth using UDF is to store it in Map which is a native data type.

HTH – Raj


Thanks Raj.

I expected the below to work

function read(topRec) { return topRec }



Yes !! recommendation is to copy it into map and return. Direct returning will be added into feature request.

Thanks – Raj