问题
I would like to query for documents that have a certain property.
I tried the following:
select * from Foo where not bar is null
But this returns me the documents even though they do not have that property. Even though it would work it would give the wrong results if there are properties with null as a value (don't know of orientdb works that way).
Is there some way to check for the existence of properties via sql?
回答1:
try :
select from Foo where bar is defined
回答2:
in case if you want to query for vertices without specific edges
select from Users where first(outE('born_in')).@rid is null
来源:https://stackoverflow.com/questions/26399485/how-do-i-query-orientdb-for-documents-without-a-certain-property