Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Database 如何知道哪些比赛只在周一举行?_Database_Neo4j_Cypher - Fatal编程技术网

Database 如何知道哪些比赛只在周一举行?

Database 如何知道哪些比赛只在周一举行?,database,neo4j,cypher,Database,Neo4j,Cypher,我试过两种代码,第一种代码不起作用,而第二种代码起作用。我基本上要展示周一有多少场比赛,并展示参加比赛的球队 MATCH (t:Teams) WHERE date({year:2019, month: 1 }) > t.Date <= date({year:2018, month:12}) RETURN t.HomeTeam AS HomeTeam, t.AwayTeam AS AwayTeam, t.Date AS Date 结果是:Count(*)0我认为在您的

我试过两种代码,第一种代码不起作用,而第二种代码起作用。我基本上要展示周一有多少场比赛,并展示参加比赛的球队

MATCH (t:Teams)
WHERE date({year:2019, month: 1 }) > t.Date <= date({year:2018, month:12})
RETURN t.HomeTeam AS HomeTeam,
    t.AwayTeam AS AwayTeam,
    t.Date AS Date

结果是:Count(*)0

我认为在您的第一次查询中可能会发生一些事情。日期匹配行

WHERE date({year:2019, month: 1 }) > t.Date <= date({year:2018, month:12})
请在第二个查询中尝试此选项

MATCH (t:Teams)
WITH [item in split(t.Date, "/") | toInteger(item)] AS dateComponents
WITH date({day: dateComponents[0], month: dateComponents[1], year: dateComponents[2]}).dayOfWeek AS date
WHERE date = 1
RETURN COUNT(*)
WITH ({day: dateComponents[0], month: dateComponents[1], year: dateComponents[2]}).dayOfWeek AS date
MATCH (t:Teams)
WITH [item in split(t.Date, "/") | toInteger(item)] AS dateComponents
WITH date({day: dateComponents[0], month: dateComponents[1], year: dateComponents[2]}).dayOfWeek AS date
WHERE date = 1
RETURN COUNT(*)