1

我已经尝试在密码中进行以下查询。

START other=node(*)
WHERE other.FirstName =~ "(?i)dh.*" AND other.UserID <> 1 
WITH other, me=node:node_auto_index(UserID = '1')
MATCH me-[myR:friends]-(x)
RETURN other.UserID, other.UserName, other.FirstName, other.LastName, other.ImagePath 
       // myR.ApprovalStatus, COUNT(distinct pMutualFriends) AS mutualFriends
//ORDER BY mutualFriends DESC
LIMIT 100;

但它给了我错误。

These columns can't be listen in the WITH statement without renaming: me=node

那么,这个查询有什么问题?

4

1 回答 1

2

您需要执行另一个 START 子句来执行此操作:

START other=node(*)
WHERE other.FirstName =~ "(?i)dh.*" AND other.UserID <> 1 
WITH other
START me=node:node_auto_index(UserID = '1')
MATCH me-[myR:friends]-(x)
RETURN other.UserID, other.UserName, other.FirstName, other.LastName, other.ImagePath 
   // myR.ApprovalStatus, COUNT(distinct pMutualFriends) AS mutualFriends
//ORDER BY mutualFriends DESC
LIMIT 100;

这在语法上应该是正确的。我不确定您的查询要做什么-感觉不对,因为这两个查询没有与 a 链接在一起match,因此您将在结果中获得otherand me/的笛卡尔积x

于 2013-07-29T12:35:57.387 回答