In SQL there's a query INSERT IGNORE
which keeps duplicate entries out of the database based on the primary key. But is there a way to achieve this functionality in OrientDB since the primary key concept here is kind of achieved using the @rid
concept?
Asked
Active
Viewed 661 times
0

marc_s
- 732,580
- 175
- 1,330
- 1,459

Rajith Gun Hewage
- 532
- 7
- 25
-
1Unrelated, but: "*in SQL there's a query Insert ignore*" - no there isn't. SQL (the query language) does not define such a thing. One specific DBMS implements an extension to the SQL language supporting that. – Jan 29 '16 at 09:41
-
So should it be changed to MySQL (I guess MySQL supports that `INSERT IGNORE` thing)? Or is it okay to keep the question this way? – Rajith Gun Hewage Jan 29 '16 at 10:03
2 Answers
1
I think you can use a unique index on that class, so you can avoid duplicate entries.

Alessandro Rota
- 3,560
- 1
- 8
- 10