3

I'm trying to build an application in which I have a functionality where I need to query nodes between two dates/Timestamps. To my surprise , Neo4j has no date property type. Why date type is not included and what is an alternative approach to this? Does any other GraphDB support Date type?

Tim Kuehn
  • 3,201
  • 1
  • 17
  • 23
Balaji Reddy
  • 5,576
  • 3
  • 36
  • 47
  • 1
    Neo4j does have a timestamp data type. – Tim Kuehn Apr 29 '16 at 15:44
  • Thank you for the response . Let me edit my question just for Date. – Balaji Reddy Apr 29 '16 at 15:50
  • 1
    Possible duplicate of [Neo4j DATE Data Types](http://stackoverflow.com/questions/21643896/neo4j-date-data-types) – cybersam Apr 29 '16 at 22:49
  • 1
    have a look at https://github.com/graphaware/neo4j-timetree – Michal Bachman May 02 '16 at 20:15
  • There is a scalar function `TIMESTAMP()` that returns the `long` version of current time since epoch. Unfortunately it doesn't take any parameters. And there's no way to convert a `long` time to a human-readable timestamp, or vice versa, within Cypher. Absolutely no support for Oracle-style `TO_DATE` and `TO_STRING`. You will have to do it on application side. *Very disappointing indeed, for a database that aims to storm the industry.* – ADTC May 15 '16 at 12:02

1 Answers1

2

If you want to load date datatype to Neo4j from PostgreSQL then first convert them into character varying using to_char function.Because in Neo4j there is no specific data type for dates

  • Welcome to stackoverflow!! Try to avoid comment in answer unless you have specific answer. Please use comment box below and Once you have sufficient reputation you will be able to comment on any post. :) – Rucha Bhatt Joshi Aug 18 '17 at 05:39