Reputation: 300
I would like to select the LATEST version of all elements in a directory based on the creation date otherwise select version 0. Does any one know if this can be achieved using the available config_spec syntax?
eg:
if (created_on >= 01-jan-2014)
element * /main/LATEST
else
element * /main/0
Upvotes: 1
Views: 76
Reputation: 300
Thanks for the hint VonC, I have achieved exactly what I need based on the following rules.
element -dir /myPath/... /main/LATEST
element /myPath/... /main/{created_since(01-Jan-2014)}
element /myPath/... /main/0
Upvotes: 2
Reputation: 1324537
You can try a time directive of selection rule.
element /myPath/... /main/{created_since(01-Jan-2014)}
element /myPath/... /main/LATEST
That could enable you to see versions based on their creation date (see time and query)
See also "time-based rule" answer.
The second rule selection LATEST, not 0, as a way to test the first rule: remember that if a parent folder was not selected by the first rule, none of its sub-elements would be considered if it was in version 0.
Upvotes: 1