versions
The versions operator shows array versions.
Synopsis
versions(named_array);
versions(vmax:true, ns: ns_name);
versions(vmax:true);
Summary
versions(named_array) lists all versions of a specific array.
versions(vmax:true, ns: ns_name) lists the maximum version of every array in namespace ns_name (or all for all namespaces).
versions(vmax:true) behaves the same as above, except that it takes the namespace from the current session.
Example
To create an array with two versions, do the following:
Create an array containing one cell with the value 10:
AFL% create array A <val:double>[i=1:1]; AFL% store(build(A, 10), A);
The output is:{i} val {1} 10
Change the values to 20:
AFL% store(build(A, 20), A)
The output is:{i} val {1} 20
To get information about the versions of A, do the following:
Use the versions operator to list the versions of array A:
AFL% versions(A);
The output is:{No} version_id,timestamp {1} 1,'2016-02-26 18:19:39' {2} 2,'2016-02-26 18:21:28'
Use the versions operator to list the maximum version of all arrays in the namespace public
AFL% versions(vmax:true, ns: public)
The output is:
{Idx} version_id,timestamp,name {0} 2,'2023-11-10 17:01:16','A'
To examine the data of different versions:
Use the scan operator and the @ array version specifier to access version 1
AFL% scan(A@1);
The output is:
{i} val {1} 10
Use the scan operator and the @ array version specifier to access version 2
AFL% scan(A@2);
The output is:
{i} val {1} 20