I have a student node with the below props.
{hopper=[true], updatedDate=[Fri Sep 16 09:28:40 UTC 2022], userId=[9c40uvdqkjjmcv4c7f4u3m7gpv], firstName=[Mounika], lastName=[Mandadi], vLabel=[Student]}
I need to query out all the student nodes whose updatedDate is less than a given date.
Queries I have tried:
g.V().has("Student","updatedDate",gt("Fri Sep 17 09:28:40 UTC
2022")).count()
This havent worked. What is the correct way to query? What index is preferrable for date comparision queries?
You really have two main options when storing dates (timestamps) and you need to compare them. I'll mention a third option at the end.
datetimeobjects from the client programming language (or use the Gremlindatetimefunction if sending queries as text.1663599168.You can also use strings if all you need to do is
gtandlttype operations but the strings need to carefully conform to the ISO 8601 standard format; such as :2022-09-19T14:57ZI prefer to use either real
datetimeobjects or epoch integers as they are easier to deserialize to code and allow additional operations such as subtraction to find timestamp deltas.