FEATURE REQUEST: Expiration Date Can Be Queried in Metadata (PHP SDK)


#1

Can we please have the expiration date as a value available to see in the metadata. I am building tools for my company that display existing cache keys and allow functions to be ran on the bucket/keys via API. Seeing the expiration date in the tool would be nice!

Thanks!


#2

Hello @nadnapz

Couchbase Server already has this feature via Virtual Extended Attributes.

The cbc tool makes use of this feature:

$ echo  "hello World"  | cbc-create  -U couchbase://localhost/bucket -u User -P password key -e 100
key                 Stored. CAS=0x154f62f237d20000

Get the document and all of the virtual extended attributes:

 $ cbc-subdoc -U couchbase://localhost/bucket -u User -P password
subdoc> get -x $document key
key                  CAS=0x154f62f237d20000
0. Size=233, RC=0x00 Success (Not an error)
{"CAS":"0x154f62f237d20000","vbucket_uuid":"0x0000011fc01a97ac","seqno":"0x0000000000000004","exptime":1535554889,"flags":0,"value_bytes":12,"datatype":["raw"],"deleted":false,"last_modified":"1535554790","value_crc32c":"0x750b641f"}
1. Size=12, RC=0x00 Success (Not an error)
hello World