how to pass parameters to a query in AQL

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

how to pass parameters to a query in AQL

teja2304
How to automate the cleanup strategy using AQL?

Let's say delete the artifacts from "abc" repo which are 1 month older.
This script should run every day as a cron that cleans up the builds.

Basically,I am looking for a strategy where I can pass the variables to a  query parameter like below.

//variable that stored the date that is 30 days ago
var date=currentDate()-30.days;

//This should give all the artifacts that are 30days older under given repo
items.find({"type":"file", "created":{"$lt":date}}

Is there any other way to achieve this?