How to query the metadata(such as ttl) of record from tools?


#1

I check Aerospike tools ( AQL and cli), and can not get any command.


#2

These are tools to look at the data and not the metadata. You could use UDF to get this information from record

local function get_metadata(rec)
   return record.ttl(rec);
end

– R


#3

Maybe some day you will add the feature in AQL


#4

You can use AQL in JSON output mode to see such details:

aql>set output json aql>set RECORD_PRINT_METADATA true aql>select * from where PK = ‘423417571’; [ { “digest”: “AAAAAAAAAAAAAAAAAAAAAAAAAAA=”, “ttl”: 344964, “gen”: 180, “bins”: { "": “Data” } } ]


#5

Note, when using where pk = xxx as in above, the digest reported by AQL is wrong. (AQL bug). also, command should be > aql>select * from <ns>.[<set>] where pk = 'xxx' (namespace and set are missing)