I am trying to create an vertex in Purchases class along with its link to Users class vertex. Following example may help you to understand what I am trying to achieve.
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)
Above command producing this error
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="*****"
Please help me with that or if you can suggest some other better technique I will be very thankful.
CREATE VERTEX
statement doesn't support that, but you can use theINSERT INTO
in addition withUNSAFE
keyword:PS
about the destination SELECT use
select from Users
instead ofselect @rid from Users