匹配语句OrientDB返回计数边沿 [英] Match Statement OrientDB return counted edges

查看:358
本文介绍了匹配语句OrientDB返回计数边沿的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  MATCH {class:M,as:n,其中:(p ='561')}。both(R)
{as:r,while :( $ depth <1)} RETURN r,n

我假设r是顶点的数量,我该怎么做才能返回边的数量?第一个观察:你可以省略,而:($ depth< 1) $ c>,因为默认情况下的MATCH语句只是遍历一个单一的级别。



我不确定你确切需要什么,但是如果你需要连接的边数到n,你可以做 RETURN r,n,r.both(R)。size() as numOfEdges


I'm running this query to iterate over graph in orientDB.

 MATCH {class: M ,as :n, where: (p = '561')}.both("R")
          {as: r, while: ($depth < 1)} RETURN  r ,n

I assume that r , is the number of the vertices , how do I do to return the number of the edges ?

解决方案

First observation: you can omit while: ($depth < 1), as the MATCH statement by default just traverses one single level.

I'm not sure what you exactly need, but if you need the number of edges connected to n, you can do RETURN r, n, r.both("R").size() as numOfEdges

这篇关于匹配语句OrientDB返回计数边沿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆