Neo4j可选的MATCH子句

Neo4j可选MATCH子句用于搜索其中描述的模式, 而对模式的缺失部分使用null。

它类似于MATCH子句;唯一的区别是, 如果找到模式的缺失部分, 则返回null。

句法:

MATCH (node:label {properties. . . . . . . . . . . . . .}) 
OPTIONAL MATCH (node)-->(x) 
RETURN x

例:

让我们以可选匹配为例, 从节点ICCT2013检索关系。由于没有这样的节点, 因此它返回null。

MATCH (a:Tornament {name: "ICC Champions Trophy"}) 
OPTIONAL MATCH (a)-->(x) 
RETURN x

输出

Neo4j可选匹配功能1
微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_47511.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?