ArangoDB AQL--图操作

示例:

顶点表:
insert {
_key:'u1',
name:'one'
} in  v_userid

insert {
_key:'u2',
name:'two'
} in v_userid


insert {
_key:'p1',
name:'px'
} in  v_phone

insert {
_key:'p2',
name:'py'
} in  v_phone

边表:
insert {
_key:'u1-p2',
u:'u1',
p:'p2'
} in  e_userid_phone

图查询:
for v,e,p
in 1..2
outbound ' v_userid/u1' graph 'graph1'
return p

说明:

基于图操作的语法:

FOR vertex[, edge[, path]]
  IN [min[..max]]
  OUTBOUND|INBOUND|ANY startVertex
  GRAPH graphName
  [OPTIONS options]

基于集合操作的预发:

FOR vertex[, edge[, path]]
  IN [min[..max]]
  OUTBOUND|INBOUND|ANY startVertex
  edgeCollection1, ..., edgeCollectionN
  [OPTIONS options]


参考:

https://docs.arangodb.com/3.2/AQL/Graphs/

个人资料
时海
等级:8
文章:272篇
访问:16.0w
排名: 2
上一篇: ArangoDB AQL--基本查询
下一篇:互联网金融运营增长+反欺诈好文章
标签: u1、outbound、userid、options、insert、面试题
隐藏