Write a NXQL query to purge deleted documents

Hi,

I want to create a purge of deleted documents for more than 2 months after the last modification date.

Can we write a NXQL query like this :

SELECT * FROM Document WHERE ecm: currentLifeCycleState = 'deleted' AND (dc: modified + INTERVAL '2 month') < TIMESTAMP '2012-08-30 14:00:00'

Or another method?

thank you

0 votes

1 answers

2502 views

ANSWER

NXQL does not have date interval arithmetic. It could be added though.
09/03/2012



Hi,

The better is to use an automation chain and fetch by query documents to remove definitely.

So here is the request I would put into the Fetch > Query operation (becarefule no space between “ecm and :” and “dc and :):

SELECT * FROM Document WHERE ecm:currentLifeCycleState = 'deleted' AND dc:modified < TIMESTAMP '@{CurrentDate.months(2).format("yyyy-MM-dd HH:mm:ss")'
1 votes