简体   繁体   中英

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

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.

尝试:

select * FROM Users LET $c = in.size() ORDER BY $c

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM