1
我試圖在Purchases類中創建一個頂點以及其與用戶類頂點的鏈接。下面的例子可以幫助你理解我想要達到的目標。如何在OrientDB中創建頂點並創建頂點
Create Edge PurchasedCarts
FROM
(CREATE VERTEX Purchases SET guid = "44b4dab7-744a-4f13-ae55-3a563e327de9", accountId = '240059', amount = 44, orderNumber = "1496890", totalItems = 2)
TO
(Select @rid from Users)
上面的命令產生這個錯誤
Error parsing query:
Create Edge PurchasedCarts FROM (CREATE VERTEX Purchases SET guid = "44b4dab7-744a-4f13-ae55-3a563e327de9", accountId = '240059', amount = 44, orderNumber = "1496890", totalItems = 2) TO (Select @rid from Users)
^
Encountered " <CREATE> "Create "" at line 1, column 1.
Was expecting one of:
<SELECT> ...
<TRAVERSE> ...
<MATCH> ...
<INSERT> ...
<RETURN> ...
<PROFILE> ...
<FIND> ...
<REBUILD> ...
<OPTIMIZE> ...
<GRANT> ...
<REVOKE> ...
<BEGIN> ...
<COMMIT> ...
<ROLLBACK> ...
<IF> ...
<SLEEP> ...
<CONSOLE> ...
DB name="*****"
請幫我說或者你可以建議一些其他更好的方法,我將非常感激。
我不認爲你可以做到這一點。您可以使用[批處理](http://orientdb.com/docs/2.2/SQL-batch.html) –