[英]How to sort vertices by edge count in OrientDB
I want to do this but it doesn't work: 我想这样做,但是不起作用:
select * FROM Users ORDER BY in.size()
I have also tried: 我也尝试过:
select * from Users ORDER BY in[label='connection'].size()
select * from Users ORDER BY inE['connection'].size()
it just returns all V's but not sorted 它仅返回所有V,但未排序
This is probably more what you were looking for. 这可能是您想要的更多东西。
select *, in().size() as size from Users order by size desc
My understanding is that that will take all incoming edges into the count. 我的理解是,这会将所有传入的边缘纳入计数。 If you only need to look at a specific edge, try the following.
如果只需要查看特定的边缘,请尝试以下操作。
select *, in_myEdge.size() as size from Users order by size desc
However, if you use the wrong edge name, the query won't give you and error and simply return a bogus result. 但是,如果您使用了错误的边名称,查询将不会给您错误,并且只会返回假结果。
ORDER BY is currently supported only on projection fields and will be a feature in future releases. 当前仅在投影字段上支持ORDER BY,并将在将来的版本中提供此功能。
尝试:
select * FROM Users LET $c = in.size() ORDER BY $c
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.