Neo4j Desktop 和 Enterprise 之间的不同结果集
Different result set between Neo4j Desktop and Enterprise
我 运行 遇到了一个奇怪的问题。我最初使用桌面版和 .Net Core Web API 开发了数据库和 API。我写了一个搜索查询来根据相互关系查找节点:
var results = _client.Cypher
.Match("(n:Person {userId: {userId}})-[]->(ct:ConnectionType)<-[]-(other:Person)")
.Where("ct.key IN {ctQuery}")
.WithParams(new
{
searchDto.userId,
ctQuery = searchDto.connectionType
})
.ReturnDistinct((other) => new
{
Profile = other.As<SearchResultsDto>()
}).Results;
在本地工作时,一切正常。但是,当我将 API 和数据库传输到 linux 服务器时,返回了一个空结果。
这个问题似乎与我使用的数据类型有关。连接节点的"key"属性为整数。 ctQuery 对象是一个 int[]。在桌面上时,一切正常。我打开浏览器并使用相同的查询,但在连接到企业服务器时仍然没有得到任何结果。当连接到桌面数据库时,我得到了结果。
如果我将 int[] 更改为 string[],我就能得到结果。
Enterprise 中是否有阻止查询 int 数组的设置?如果可以,是否可以更改?
我有很多将使用密钥的查询,我不想经常将字符串转换为整数并再次转换回来。
没有您描述的设置。
在 Enterprise Server 中加载数据时,您可能错过了字符串到整数的转换。
您可以 运行 查询将 ConnectionType
键的所有 String 值转换为 Integer。
MATCH (n:ConnectionType)
SET n.key= toInt(n.key)
我 运行 遇到了一个奇怪的问题。我最初使用桌面版和 .Net Core Web API 开发了数据库和 API。我写了一个搜索查询来根据相互关系查找节点:
var results = _client.Cypher
.Match("(n:Person {userId: {userId}})-[]->(ct:ConnectionType)<-[]-(other:Person)")
.Where("ct.key IN {ctQuery}")
.WithParams(new
{
searchDto.userId,
ctQuery = searchDto.connectionType
})
.ReturnDistinct((other) => new
{
Profile = other.As<SearchResultsDto>()
}).Results;
在本地工作时,一切正常。但是,当我将 API 和数据库传输到 linux 服务器时,返回了一个空结果。
这个问题似乎与我使用的数据类型有关。连接节点的"key"属性为整数。 ctQuery 对象是一个 int[]。在桌面上时,一切正常。我打开浏览器并使用相同的查询,但在连接到企业服务器时仍然没有得到任何结果。当连接到桌面数据库时,我得到了结果。
如果我将 int[] 更改为 string[],我就能得到结果。
Enterprise 中是否有阻止查询 int 数组的设置?如果可以,是否可以更改? 我有很多将使用密钥的查询,我不想经常将字符串转换为整数并再次转换回来。
没有您描述的设置。
在 Enterprise Server 中加载数据时,您可能错过了字符串到整数的转换。
您可以 运行 查询将 ConnectionType
键的所有 String 值转换为 Integer。
MATCH (n:ConnectionType)
SET n.key= toInt(n.key)