在Neo4J中与1个密码创建2个关系

时间:2017-04-26 14:44:32

标签: neo4j cypher

使用数据库用户从库中借书我想创建1个查询2个具有相同日期的借用。

<input type="hidden" th:name="${_csrf.parameterName}"  th:value="${_csrf.token}" />

我认为那会做我想要的,但只创造了'小时'。我在这里缺少什么?

2 个答案:

答案 0 :(得分:1)

为什么你只使用一个&#39; b&#39;两本书?你可以随心所欲地使用它,对我来说你可以这样做:

MATCH (u:User), (b1:Book),(b2:Book)
WHERE u.Name = 'Al' AND u.Surname = 'Pacino' 
AND b1.title = 'The Hours' 
AND b2.title = 'War and Peace' 
CREATE (u)-[:LEND {date:['16 March 2017']}]->(b1) 
CREATE (u)-[:LEND {date:['16 March 2017']}]->(b2)

答案 1 :(得分:0)

您可以创建任意数量的关系,您需要做的只是传入要匹配的属性列表。

在这种情况下,您可以传递书名列表:

public class StandardServletMultipartResolver implements MultipartResolver
    (...)
    public boolean isMultipart(HttpServletRequest request) {
        // Same check as in Commons FileUpload...
        if (!"post".equals(request.getMethod().toLowerCase())) {
            return false;
        }
        String contentType = request.getContentType();
        return (contentType != null && contentType.toLowerCase().startsWith("multipart/"));
    }

如果您有索引:Book(title),那么:Book MATCH将使用索引查找。