【问题标题】:Getting error while runing multiple return statement from cypher query从密码查询运行多个返回语句时出错
【发布时间】:2014-08-17 14:34:10
【问题描述】:

我正在使用 neo4j graph db,这是语法错误还是错误的程序我收到了一些类似这样的错误:array(4) { ["message"]=> string(108093) "Don't know how to treat that as a predicate: 我的查询是

       "query" => "match (u : UserProfile {token:{Token}})-[:HAS_SUBSCRIBED]->(upd)-   [:POSTED_UPDATE|PREV*0..]->(sel)
                    return (upd.image OR upd.logo),upd.firstName,upd.uId,sel.content,sel.created skip 0 limit 15",
    "params" => array (
            "Token" => "$token" 
    ) 

我想返回关键用户所拥有的图像或徽标,因为我用于具有徽标的公司和用户具有图像的同一节点。

【问题讨论】:

    标签: php neo4j cypher


    【解决方案1】:

    OR 运算符适用于布尔表达式。我猜你想使用COALESCE 函数,它返回参数列表中的第一个非空参数:

    ...
    return coalesce(upd.image, upd.logo), ...
    

    【讨论】:

    • 它的工作,非常感谢。很多次你帮助了我,再次感谢@Stefan Armbruster
    猜你喜欢
    • 2022-07-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-19
    • 1970-01-01
    • 2020-12-20
    相关资源
    最近更新 更多