查询包含更多过滤器时,结果错误

时间:2018-10-08 10:34:29

标签: neo4j cypher

MATCH (prs:Issue)-[:REPORTED_BY]-(custs) 
MATCH (prs)-[:CLOSED_ON]-(cls:IssueClosedDate) 
MATCH (prs)-[:REPORTED_BY]->(custNode:Customer) 
MATCH (prs)-[:APP_FUN_CAT]-(afc:AppFunCat) 
MATCH (prs)-[:REPORTED_IN]-(release:Release)
WHERE  afc.func STARTS WITH 'WEB'  AND NOT(cls.closedDate = '' ) AND afc.appName STARTS WITH 'SOCKET' 
AND apoc.date.parse(cls.closedDate,'s', 'MM/dd/yyyy') >= apoc.date.parse('01/01/2014','s', 'MM/dd/yyyy') 
AND apoc.date.parse(cls.closedDate,'s', 'MM/dd/yyyy') <= apoc.date.parse('06/13/2017','s', 'MM/dd/yyyy') 
AND  afc.cat IN ["ALL","NEW","SOFTWARE","UNDETERMINED"] 
RETURN prs.prId AS prList, custs.customerName AS customer, afc.cat AS category, cls.closedDate AS prClosedDate, release.relName as releaseName `

上面的查询给了我如下所示的结果:

 "prList"  "funName"  "year"  "afc.appName"  "afc.cat"  "cls.closedDate"  
  7371322  "WEB"      "2015"  "SOCKET"       "SOFTWARE"  "4/27/2015"  
  8277662  "WEB"      "2015"  "SOCKET"       "SOFTWARE"  "9/24/2015"  
  7513015  "WEB"      "2015"  "SOCKET"       "SOFTWARE"  "9/24/2015" 

如果我检查数据库,则此结果不正确。它应该给出的列表数量要比这个多。

发现如果我移除其中一个过滤器     afc.appName STARTS WITH 'SOCKET'或     apoc.date.parse(cls.closedDate,'s', 'MM/dd/yyyy') <= apoc.date.parse('06/13/2017','s', 'MM/dd/yyyy')或     fc.cat IN ["ALL","NEW","SOFTWARE","UNDETERMINED"]

我得到的结果是正确的。因此,我可以说数据库构建正确。尽管上面的查询显示了三个结果,但列数却更多。

neo4j数据库是否存在无法执行此操作的限制? 有人可以建议我如何解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

正如InverseFalcon在评论中所说,版本可能是问题。我们更新了以下版本:

Neo4j Browser version: 3.0.1 to 3.2.8 
Neo4j Server version: 3.2.0 to 3.4.8 (community) 
apoc-3.2.3.5-all.exe to apoc-3.4.0.3-all.exe

现在所有过滤器都运行良好。问题解决了。