我没有理解某些行为,并希望有人在这里解释它。如果我运行Neo4j查询:
MATCH (node1-[:depends*]->node2)
WITH [node1.name, node2.name] as dependencies
return dependencies
我得到了node1的元组列表,node2显示了node1在图中某处依赖于node2的所有元组。
如果我执行以下查询,我希望返回依赖项中的所有元组,但我得到一个空列表:
MATCH (node1-[:depends*]->node2)
WITH [node1.name, node2.name] as dependencies
return dependencies
MATCH n1--n2
WHERE ([n1.name,n2.name] IN dependencies)
return n1,n2
现在我如何在子查询中使用依赖项?
答案 0 :(得分:0)
多个var modules = new List<Module>()
{
new Module() { Id = 1, ModuleName = "Contabilidad", FontAwesomeClass = "fa-ambulance" },
new Module() { Id = 2, ModuleName = "Recursos Humanos", FontAwesomeClass = "fa-heartbeat" },
new Module() { Id = 3, ModuleName = "Inventario", FontAwesomeClass = "fa-anchor" },
new Module() { Id = 4, ModuleName = "Produccion", FontAwesomeClass = "fa-binoculars" },
new Module() { Id = 6, ModuleName = "Ventas", FontAwesomeClass = "fa-coffee" },
new Module() { Id = 7, ModuleName = "Compras", FontAwesomeClass = "fa-calendar-o" },
new Module() { Id = 8, ModuleName = "Cotizaciones", FontAwesomeClass = "fa-building" }
};
context.ModulosPorUsuario.Add(new ModulosPorUsuario()
{
Email = "companyadmin@xx.onmicrosoft.com",
Modules = modules
});
context.SaveChanges();
子句可以在同一个查询中互相关联,因此这可能对您有用:
MATCH