How to handled document not found error

57 views
Skip to first unread message

NanthaKumar Loganathan

unread,
Oct 3, 2022, 7:53:48 AM10/3/22
to ArangoDB
Hi ,

I have a document and it has refernce document

when i try to remove , sometimes the reference document is not present, so i am getting below error 

com.arangodb.ArangoDBException: Response: 404, Error: 1202 - AQL: document not found (while executing)

user document
name: "test"
address : "addresses/1"

addresses document
street: "street 1"
disctrict: "distriect"


query:
WITH users, addresses
for user in users
FILTER user.id == @id
LET add = DOCUMENT(addresses, user.address)
remove add in addresses


Simran Spiller

unread,
Dec 6, 2022, 6:29:05 AM12/6/22
to ArangoDB
You can set the ignoreErrors option to true for the REMOVE operation:
REMOVE | High-level Operations | AQL | ArangoDB Documentation
Reply all
Reply to author
Forward
0 new messages