Tan Ho
Tan Ho

Reputation: 85

OrientDB Wrong search result


Seem that OrientDB doesn't return the correct result for the simple search.
I created a class node item with 2 properties id and flag

flag can be set by 1, 0, or null value.

I use the query below to get all item which has flag is 1

`select from item where flag = 1`

But the query returns nothing.
Note: I have tested on 2.2.7 and 2.2.10, and seem that this issue only occurs if flag was defined in schema before feeding data. Is it bug?

image UPDATED: Added sample database. Get it here

Upvotes: 0

Views: 52

Answers (2)

Alessandro Rota
Alessandro Rota

Reputation: 3570

If you use select from item where 1 = flag it works.

For your query select from item where flag = 1 could you open an issue on github attaching your database ?

Upvotes: 1

Oleksandr Gubchenko
Oleksandr Gubchenko

Reputation: 1369

Tested on 2.2.10, no problems here:

create class item extends v
create property item.id STRING
create property item.flag DECIMAL
insert into item(id,flag) values ("id1",1)
select from item where flag = 1

Also added UNIQUE index on id from studio -> schema.

Output: Select ID OrientDB

Upvotes: 1

Related Questions