Reputation: 16734
I am using the neography
gem hosted by GrapheneDB.
I need to send out recurring events.
What I did with my previous DB is check if object[:next_occurrence] is < TimeDate.now
I don't see how I can do this type of search in neo4j nor in the documentation:
Upvotes: 0
Views: 46
Reputation: 30417
Using just Cypher, you can use the timestamp()
function to generate a unix timestamp in ms (representing the current instant), which you can store as a property on nodes or relationships.
That can let you run these kinds of comparisons. So if you have nodes with next_occurrence
properties, and you already have an event
variable bound to a particular node, you could use a predicate like:
...
WHERE event.next_occurrence < timestamp()
...
With an index on the label/property, these kinds of predicates can use the index to find starting nodes fast (all events in the past, in the future, or within ranges).
Upvotes: 0