我已將csv文件導入到arangodb,它們是虛擬機和服務器。現在,我想創建圖表來顯示虛擬機和服務器的關係。ArangoDB中的邊緣定義
我閱讀手冊並嘗試定義Edge以關聯兩個集合。但是我不清楚如何定義邊緣。 (即我需要服務器的名稱與的虛的虛擬主機關聯)
arangosh> myGraph.v1 = db.vertex.insert({名: 「頂點1」});
arangosh> myGraph.v2 = db.vertex.insert({name:「vertex 2」});
arangosh> myGraph.e1 = db.relation.insert(myGraph.v1,myGraph.v2, ........> {label:「knows」});
在這個例子中,如何定義myGraph?
JavaScript exception: ReferenceError: myGraph is not defined
!myGraph.v1 = db.vertex.insert({ name : "vertex 1" });
!^
stacktrace: ReferenceError: myGraph is not defined
at <shell command>:1:1
另外,我應該一個一個地定義集合的屬性? myGraph.v1 = db.server.insert({name:「server」}); myGraph.v2 = db.virtualmachine.insert({name:「virtualhost」});
感謝您的幫助。
與答案添加一些解釋如何回答幫助OP在固定電流問題 –