How can I query an edge property by value?

扶醉桌前 提交于 2020-01-15 15:30:37

问题


I'm using OrientDB (Community-2.0.9) and have two vertices: Person and University and one edge: isStudent. The edge isStudent has the property 'mark' as float. Person --isStudent--> University.

Now I want to select all persons, where the mark is greater than 3.0, but I got no results, but if I query for equality I got two results.

Do you have any ideas how to solve this?

Queries:

SELECT FROM PERSON WHERE out_isStudent.mark = 3.4 --> two results
SELECT FROM PERSON WHERE out_isStudent.mark > 3.0 --> no results

回答1:


If you:

select out_isStudent.mark from Person

you see that it returns the list [3.4] instead of 3.4

The query that should not work is the first since you're comparing [3.4] == 3.4

You can achieve what you want with:

select from Person where out_isStudent[0].mark > 3


来源:https://stackoverflow.com/questions/30570467/how-can-i-query-an-edge-property-by-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!