cypher - Adding timestamps in neo4j -


i looking find birth_date between range using timestamp (long value) in neo4j. here matching user, id 10662 . along other users, date_birth in range between +3 , -3 years of u.date_birth

the value of 10800000 3 years in milliseconds, not getting results, sure wrong. not able locate problem.

i appreciate help.

match (u:user {id : "10662"})-[r:has_profile]->(p:profile)  , (u2:user)-[r2:has_profile]->(p2:profile)   p.user_id <> p2.user_id  , u2.date_birth >= u.date_birth -toint(10800000) , u2.date_birth <= u.date_birth + toint(10800000)  return collect (u2.id) id; 

3 years in milliseconds (assuming 365 days per year) 94608000000.

does work you?

match (u:user {id : "10662"})-[r:has_profile]->(p:profile), (u2:user)-[r2:has_profile]->(p2:profile)   p.user_id <> p2.user_id ,   abs(u2.date_birth - u.date_birth) >= 94608000000 return collect(u2.id) id; 

Comments