I have created a set of data in Nebula Graph Database, I want to know how to get the out-degree and in-degree of a vertex with a given name.
(root@nebula) [basketballplayer]> match (v) return v limit 10
+-----------------------------------------------------------+
| v |
+-----------------------------------------------------------+
| ("player102" :player{age: 33, name: "LaMarcus Aldridge"}) |
| ("player106" :player{age: 25, name: "Kyle Anderson"}) |
| ("player115" :player{age: 40, name: "Kobe Bryant"}) |
| ("player129" :player{age: 37, name: "Dwyane Wade"}) |
| ("player138" :player{age: 38, name: "Paul Gasol"}) |
| ("team209" :team{name: "Timberwolves"}) |
| ("team225" :team{name: "Bucks"}) |
| ("team226" :team{name: "Magic"}) |
| ("player108" :player{age: 36, name: "Boris Diaw"}) |
| ("player122" :player{age: 30, name: "DeAndre Jordan"})
The out-degree of a vertex refers to the number of edges starting from that vertex, while the in-degree refers to the number of edges pointing to that vertex.
This is a very slow operation to get the out/in degree since no accelaration can be applied (no indices or caches). It also could be out-of-memory when hitting a supper-node.