documentation inconstistency

43 views
Skip to first unread message

hartmut bischoff

unread,
Aug 26, 2016, 2:26:41 AM8/26/16
to OrientDB

Deleting Edges from a Sub-query

Consider a situation where you have an edge with a Record ID of #11:0 that you want to delete. In attempting to do so, you run the following query:

orientdb> DELETE EDGE FROM (SELECT FROM #11:0)
(...)


Syntax

DELETE EDGE 
    ( <rid>
      |
      [<rid> (, <rid>)*] 
(...)


If I want to delete the Edge #11:0, I run 
DELETE EDGE #11:0


The documentation tells me to use
DELETE EDGE E WHERE @rid IN (SELECT FROM #11:0) 
instead


odbuser

unread,
Aug 26, 2016, 4:36:37 AM8/26/16
to orient-...@googlegroups.com
I think the documentation is currently misleading but not wrong.

When you know the rid of the edge, the simplest syntax is:
DELETE EDGE #11:0

But the following two statements will also work:
DELETE EDGE WHERE @rid IN (SELECT FROM #11:0)

DELETE EDGE E WHERE
@rid IN (SELECT FROM #11:0)

And the following will not b/c the record reference in the FROM should be a vertex not an edge:
DELETE EDGE FROM (SELECT FROM #11:0)
Cannot retrieve a vertex with the RID #11:0 because it is an edge

But the documentation on http://orientdb.com/docs/master/SQL-Delete-Edge.html is referring to subqueries so the example may not be the best to illustrate the point.

In any case, I suggest that you open an issue in the git documentation project:
https://github.com/orientechnologies/orientdb-docs/issues
and make sure you mention the version of OrientDB that you are using, reference the link to the documentation, what it says, and what you think it should say.

Luca Garulli

unread,
Aug 26, 2016, 1:18:27 PM8/26/16
to OrientDB
I've just updated the documentation with 2 more examples ;-)

Best Regards,

Luca Garulli
Founder & CEO

Want to share your opinion about OrientDB?
Rate & review us at Gartner's Software Review


On 26 August 2016 at 03:36, odbuser <odbu...@gmail.com> wrote:
I think the documentation is currently misleading but not wrong.

When you know the rid of the edge, the simplest syntax is:
DELETE EDGE #11:0

But the following two statements will also work:
DELETE EDGE WHERE @rid IN (SELECT FROM #11:0)
DELETE EDGE E WHERE
@rid IN (SELECT FROM #11:0)

And the following will not b/c it's the record reference in the FROM should be a vertex not an edge:

DELETE EDGE FROM (SELECT FROM #11:0)
Cannot retrieve a vertex with the RID #11:0 because it is an edge

But the documentation on http://orientdb.com/docs/master/SQL-Delete-Edge.html is referring to subqueries so the example may not be the best to illustrate the point.

In any case, I suggest that you open an issue in the git documentation project:
https://github.com/orientechnologies/orientdb-docs/issues
and make sure you mention the version of OrientDB that you are using, reference the link to the documentation, what it says, and what you think it should say.






On Friday, August 26, 2016 at 2:26:41 AM UTC-4, hartmut bischoff wrote:

Deleting Edges from a Sub-query

Consider a situation where you have an edge with a Record ID of #11:0 that you want to delete. In attempting to do so, you run the following query:

orientdb> DELETE EDGE FROM (SELECT FROM #11:0)
(...)


Syntax

DELETE EDGE 
    ( <rid>
      |
      [<rid> (, <rid>)*] 
(...)


If I want to delete the Edge #11:0, I run 
DELETE EDGE #11:0


The documentation tells me to use
DELETE EDGE E WHERE @rid IN (SELECT FROM #11:0) 
instead


--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

odbuser

unread,
Aug 29, 2016, 1:48:50 AM8/29/16
to OrientDB
While it's good to have the two new examples, the confusion is in this section:
http://orientdb.com/docs/master/SQL-Delete-Edge.html#deleting-edges-from-a-sub-query

Not the examples section.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages