Discussion:
[arangodb-google] Update some fields based on another field
Iro
2018-10-09 09:00:11 UTC
Permalink
I want to update some fileds in a document but without knowing "_key"

I want to make a query as in Mysql or Oracle

mysql
UPDATE users
SET name = "John Smith"
WHERE email= "***@test.com";

arangodb first try
UPDATE { email: "***@test.com"}
WITH { name: "JohnSmith"}
in users
(error showed Query: AQL: missing document key (while executing))

arangodb second try
REPLACE{ email: "***@test.com"}
WITH { name: "JohnSmith"}
in users
(error showed Query: AQL: missing document key (while executing))

Where to find more information about this issue and how can i make this
query

Best
--
You received this message because you are subscribed to the Google Groups "ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arangodb+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Iro
2018-10-09 09:20:29 UTC
Permalink
Solved

maybe there is another way but this solved my problem

FOR u IN users FILTER u.email= "***@test.com" UPDATE u WITH { name:
"JohnSmith" } IN users
Post by Iro
I want to update some fileds in a document but without knowing "_key"
I want to make a query as in Mysql or Oracle
mysql
UPDATE users
SET name = "John Smith"
arangodb first try
WITH { name: "JohnSmith"}
in users
(error showed Query: AQL: missing document key (while executing))
arangodb second try
WITH { name: "JohnSmith"}
in users
(error showed Query: AQL: missing document key (while executing))
Where to find more information about this issue and how can i make this
query
Best
--
You received this message because you are subscribed to the Google Groups "ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arangodb+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...