Ostico / PhpOrient

PhpOrient - Official Php driver based on the binary protocol of OrientDB.
Other
68 stars 37 forks source link

Cannot update Index when updating record #92

Closed christianascone closed 7 years ago

christianascone commented 7 years ago

Hi, I'm facing some problems updating a record with an Index (NOTUNIQUE_HASH_INDEX).

I'm updating my record with this line

$this->getDBInstance()->recordUpdate($item->setOData($data));

getDBInstance() simply returns my instance created with dbOpen().

My class has a property user_id, which is correctly updated (I can see the updated value in orient studio), but if I try to query filtering by that field, it behaves like no update has been done.

For example, with a my_class object with user_id == 1, If I update user_id to 2, then I query with:

SELECT FROM my_class WHERE user_id = 2

It doesn't return anything, but If I query with:

SELECT FROM MY_CLASS WHERE user_id = 1

It still returns the old row, but it shows user_id is 2.

If I directly update in Orient console or Orient studio, it works well, I face this problem just with my php code.

Thanks in advance

andreyvk commented 7 years ago

@christianascone I've had index problems before. Are you on Orient 2.2? Please refer to this post https://github.com/Ostico/PhpOrient/issues/89 and see if you can find anything

christianascone commented 7 years ago

@andreyvk Thank you very much, I'll take a look. Yeah, I'm on Orient 2.2.

christianascone commented 7 years ago

Fixed in 135de3526844a741f8f7a495c684be87d3ffd4c2 Duplicate of #89