Neo4j cypher: set cutofftime (datetime) property for node

You need to set the datetime property for node. Need to create node Work:

CREATE (w:Work {type: "tech", mode: "E", cut_off_time: "12:10:00"})

      

There is a way that I can define hours, minutes and year as different properties:

{hours: 12, minutes: 10, seconds: 00}

,

but how can i set it as one property. How can I define it as a datetime object in neo4j, or is it just treated as a string.

+3
datetime neo4j cypher


source to share


1 answer


Neo4j has no datatype datetime

. So you can keep it:

  • as a string how you do
  • in multiple fields (like you suggested)
  • with a time tree like nodes ( https://neo4j.com/blog/modeling-a-multilevel-index-in-neoj4/ )
  • how long in the property (ex: time in minutes)


The choice is yours, but it depends on what requests you would like to make.

Greetings

+2


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics