我们正在努力实现类似的目标 - 但我只是在下面举一个例子:
是否可以创建此类方案?因为当我试图添加第二行时,它不会添加任何内容。
谢谢, PK!
答案 0 :(得分:3)
当然可以。您没有提供确切的Cypher查询,因此不清楚您哪里出错了。
但是,这是一个工作示例(假设数据库已经包含那些Movie
和MATCH (a:Actor {name: 'Keanu Reeves'}), (m:Movie {title: 'The Matrix'})
CREATE
(a)-[r1:ACT_IN {role:'main actor'}]->(m),
(a)-[r2:ACT_IN {role:'side actor'}]->(m);
个节点):
var x = db.Campaigns.Where(w => w.ClientID == user.ClientID)
.GroupJoin(db.Divisions, c => c.DivisionID, d => d.id, (c, d) => new { cmp = c, Division = d.FirstOrDefault().Name })
.GroupJoin(db.Links, cdl => cdl.cmp.id, l => l.campaignID, (cdl, l) => new { cdl.cmp, cdl.Division, Links = l.Count() })
.ToList()
.Select(s => new
{
CampaignName = s.cmp.Name,
Campaignid = s.cmp.id,
Division = s.Division ?? "-",
Created = s.cmp.created,
Links = s.Links
});