Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get the automatic Index to work with OrientDB Server v2.0-M2 #3138

Closed
Bretto opened this issue Dec 5, 2014 · 2 comments
Closed

Can't get the automatic Index to work with OrientDB Server v2.0-M2 #3138

Bretto opened this issue Dec 5, 2014 · 2 comments
Assignees

Comments

@Bretto
Copy link

Bretto commented Dec 5, 2014

CREATE CLASS User extends OUser
CREATE PROPERTY User.id STRING
CREATE INDEX User.id UNIQUE
insert into User set name = 'visitor', status = 'ACTIVE', password = 'visitor', roles = [#4:3]
select from User

----+-----+-------+------+--------+-----
#   |@RID |name   |status|password|roles
----+-----+-------+------+--------+-----
0   |#15:0|visitor|ACTIVE|visitor |[1]
----+-----+-------+------+--------+-----

select from index:User.id
0 item(s) found. Query executed in 0.001 sec(s).

The property id is empty, and no index was created, is this a bug ? I am trying to get an automatic generated Unique "id" associated with User.

@vitorenesduarte
Copy link
Contributor

The property id is empty because you didn't insert one.

In OrientDB, each record has an auto assigned Unique ID

You don't have to worry about that, the column @Rid is already unique.
(you can read more about it here and here.

@lvca lvca closed this as completed Dec 6, 2014
@lvca lvca self-assigned this Dec 6, 2014
@Bretto
Copy link
Author

Bretto commented Dec 7, 2014

Yes but have a look at this question,
#3137
The @Rid is changing... I need a unique and persistent value, do you have any recommendation ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants