数据准备 Create index on:User(id); Create index on:Goods(name); merge (u:User{id:‘1’}) merge (g:Goods{name:‘待联系’}) merge (u)-[:send]->(g); merge (u:User{id:‘1’}) merge (g:Goods{name:‘柴油’}) merge (u)-[:send]->(g); merge (u:User{id:‘2’}) merge (g:Goods{name:‘待联系’}) merge (u)-[:send]->(g); merge (u:User{id:‘3’}) merge (g:Goods{name:‘待联系’}) merge (u)-[:send]->(g); merge (u:User{id:‘4’}) merge (g:Goods{name:‘待联系’}) merge (u)-[:send]->(g); merge (u:User{id:‘5’}) merge (g:Goods{name:‘待联系’}) merge (u)-[:send]->(g); merge (u:User{id:‘6’}) merge (g:Goods{name:‘待联系’}) merge (u)-[:send]->(g);
要查询只发布过待联系货物的用户 match (u:User)-[r:send]->(g:Goods) with count® as rc ,g,u where rc = 1 and g.name = ‘待联系’ return u; 为什么会出现 id 为 1的用户节点?如何才能正确输出 只发布了待联系货物的 用户