paradocslover
paradocslover

Reputation: 3294

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

Assume you have a set as follows:

+-------+-------+
| PK    | value |
+-------+-------+
| "pk1" | 24    |
+-------+-------+
1 row in set (0.105 secs)

How to get the metadata for this?

Upvotes: 3

Views: 3125

Answers (1)

paradocslover
paradocslover

Reputation: 3294

To get the metadata, all you need to do is run this command before running the query:

set RECORD_PRINT_METADATA true

Now, when you query the set

select * from test.segments

you can see additional metadata of the set, as follows:

+-------+-------+--------------------------------+------------+-------+-------+
| PK    | value | {edigest}                      | {set}      | {ttl} | {gen} |
+-------+-------+--------------------------------+------------+-------+-------+
| "pk1" | 24    | "Rn/5rHEQGWvPOSBK+vHRMyLkFyo=" | "segments" | 57    | 1     |
+-------+-------+--------------------------------+------------+-------+-------+
1 row in set (0.175 secs)

NOTE:

  1. The command has to be run just once. It holds true for all the queries that come after it.
  2. To go back to the default behaviour, set the argument to false

Upvotes: 9

Related Questions