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

Matt Camp
  • 205
  • 2
  • 8

1 Answers1

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
Matt Camp
  • 205
  • 2
  • 8
  • 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 thedatetime()` 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 '19 at 22:09