0

I need to insert date value in a node. Something like creation date for another node. But in cayley, we could only insert string datatype. I may use the toString() and save the date as string. But, while retrieving, I need to filter by giving a date range. How would I possibly do this?

BTW, I'm using gremlin programming language to retrieve.

Hari Ram
  • 317
  • 4
  • 21

2 Answers2

1

Cayley recognizes schema.org data types, thus you can use DateTime type for your values:

"1990-07-04T17:25:41Z"^^<http://schema.org/DateTime>

Later you can use Gizmo to query date ranges:

var d = new Date(1900, 1, 1);
g.V().Has("<birthDate>", gt(d)).All()
0

Perhaps you can store the dates as unix time-stamps? That way, even if you do a string comparison you'll get the correct results.

Muhammad Ali
  • 712
  • 7
  • 14