I am trying to create a gremlin query for AWS Neptune which checks for a particular property on a node (lastUpdated) and returns all nodes that have value smaller than a certain number. lastUpdated is epoch timestamp in this case, and I am trying to find all nodes which have lastUpdated 90 days less than current timestamp.
Here is the query that I wrote:
g.V().hasLabel('nodelabel').hasNot('lastUpdated',P.gt(1544916150)).count()
To make this query dynamic, so that whenever it is fired, I get all nodes more than 90 days old, I changed it to following:
g.V().hasLabel('nodelabel').has('lastUpdated',not(P.gt(1552798296-7776000))).count()
where 1552798296 is current_date and 7776000 is number of seconds in 90 days
Apparently, subtraction is not that straightforward in Gremlin. Any hints/suggestions on how I can write this gremlin query?
Thanks