Search code examples
orientdborientdb2.2

Does REGEXP constraint work in orientdb?


Documentation describes possibility to do regexp constraints:

ALTER PROPERTY Account.gender REGEXP "[M|F]"

I always receive exception:

com.orientechnologies.orient.core.command.OCommandExecutorNotFoundException:
Cannot find a command executor for the command request: ...

Every other thing works. Did you have this problem? How did you fix it? Should I create an issue?

EDIT:

I use version 2.2.18. I was trying to execute this code:

CREATE CLASS Account extends V;
CREATE PROPERTY Account.Gender STRING (MANDATORY TRUE, MAX 20, REGEXP "[M|F]");

I also don't see regexp option when inspecting scheme in studio. There is everything else: mandatory, read only, not null, min, max, collate, etc... but no regexp.


Solution

  • Did you create the Account class and the gender property before doing this request?

    This is working :

    CREATE CLASS Account extends V
    CREATE PROPERTY Account.gender STRING
    ALTER PROPERTY Account.gender REGEXP "M|F"
    

    EDIT :

    You actually can't do it in one request (you need to alter the property to add regexp) I don't think it's normal so you can create an issue.

    Hope it helps