I'm implementing a @Query in a @Repository with Spring Data Neo4j. Strangely the query that squeezes directly into the Neo4j Browser is identical to that presented in the console. As below:
Query Neo4j in Browser:
MATCH (u:User)-[v:VISITS]->(p:Place)
WITH u, v, p, COUNT(v) AS cnt, point({latitude: v.latitude, longitude: v.longitude}) AS visitPoint,
point({latitude: -15.143200, longitude: -39.724000}) AS pointParameter
WHERE (cnt = 1 OR cnt IS NULL) AND
(5 < datetime(v.created).hour <= 17) AND
(v.totalTimeMin <= 10 OR 10 > v.totalTimeMin) AND
(datetime(v.created).dayOfWeek IN [2, 3, 1] OR [2, 3, 1] IS NULL) AND
(datetime("2018-10-29T14:45:53.205").hour <= datetime(v.created).hour < datetime("2018-11-01T17:45:53.205").hour) AND
(distance(visitPoint, pointParameter) <= 500.00) AND
(p.subCategory = 2)
RETURN u
Query that is displayed in the console:
Request: MATCH (u:User)-[v:VISITS]->(p:Place)
WITH u, v, p, COUNT(v) AS cnt
WHERE (cnt = {amountVisit} OR cnt IS NULL) AND
({hourVisitStart} < datetime(v.created).hour <= {hourVisitEnd}) AND
(v.totalTimeMin <= {timeInMin} OR {timeInMin} > v.totalTimeMin) AND
(datetime(v.created).dayOfWeek IN {daysOfWeek} OR {daysOfWeek} IS NULL) AND
({periodStart} <= datetime(v.created) < {periodEnd}) AND
(distance(point({latitude: v.latitude, longitude: v.longitude}), point({latitude: {latitude}, longitude: {longitude}})) <= {radius}) AND
(p.subCategory = {subCategory})
RETURN u
The parameters used in the repository Query were:
params {
amountVisit=1,
hourVisitStart=5,
hourVisitEnd=17,
timeInMin=10,
daysOfWeek=[1, 3, 2],
periodStart={dayOfMonth=29, dayOfWeek=MONDAY, dayOfYear=302, year=2018, month=OCTOBER,
hour=14, minute=45, second=53, nano=205000000, monthValue=10, chronology={calendarType=iso8601, id=ISO}},
periodEnd={dayOfMonth=1, dayOfWeek=THURSDAY, dayOfYear=305, year=2018, month=NOVEMBER,
hour=17, minute=45, second=53, nano=205000000, monthValue=11, chronology={calendarType=iso8601, id=ISO}},
latitude=-15.1432,
longitude=-39.724,
radius=500.0,
subCategory=2}
I'm not understanding the reason of my query round in the browser bringing me the results I expect and the results of the query via repository not.
Thank you for your attention. :)