簡體   English   中英

兩個頂點之間的Gremlinepipeline邊緣

[英]Gremlinepipeline Edges between two Vertex

要使用Java代碼中的Gremline管道檢查頂點之間的邊緣? 我能夠創建邊,但是如果我們再次賦予相同的頂點,則會創建新邊。 我想在2個頂點之間創建一個唯一的邊。 有什么幫助嗎? 我正在使用orientDB

您可以在Edge類上創建唯一索引,該索引將為您提供約束

create class Foo extends V
create class FooEdge extends E
create property FooEdge.in LINK
create property FooEdge.out LINK

create index FooEdge_in_out on FooEdge (out,in) unique
insert into Foo set name = 'Foo1'
insert into Foo set name = 'Foo2'
create edge FooEdge from (select from Foo where name = 'Foo1') to (select from Foo where name = 'Foo2')
/* fail */
create edge FooEdge from (select from Foo where name = 'Foo1') to (select from Foo where name = 'Foo2')

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM