Danicroque belmar Danicroque belmar - 3 months ago 14
Python Question

OrientDB: How can I create a property unique using SQL?

I have a little question for you, I don't know how create a property UNIQUE. I know the SQL command for create a property, but don't know how do this UNIQUE.

And I can't use the app studio of OrientDB (would be most easy for me but...)

This is the command that I know:

"CREATE PROPERTY user.name STRING"


Thanks in advance.

Answer

You can create index on this particular property.

CREATE INDEX user.name UNIQUE

Take a look here: Console - CREATE INDEX