0

I am trying to do a temporal query similar to below:

MATCH (n:Event)
WHERE datetime(n.date) = datetime("2019-01-01")
RETURN n

But some NaT values have snuck into my n.date property. Is there any way to still do this query without having to update those nodes?

I can't remove the Date field from the nodes that have NaT as a value because the nature of the node the date is actually part of the node key.

TIA

0

My bad.. didn't think to exclude NaT from the query.

MATCH (n:Event)
WHERE n.date <> "NaT" AND datetime(n.date) = datetime("2019-01-01")
RETURN n
  • Keep in mind that your query will not allow an index lookup (for an index on :Event(date)` since your query requires you to transform it using the datetime() function. If you're using a Neo4j version >= 3.4.x, then you can store native temporal types as properties. If you can do this for this property across all :Event nodes, you can take advantage of index lookups and speed up your related queries. – InverseFalcon May 28 at 22:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.