Hi, 
the only way AQL offers to break the scope is to use a sub-query, which 
will then be executed before the main query. 

On Friday, May 16, 2025 at 12:41:28 PM UTC+2 [email protected] wrote:

> Hi,
>
> The query below inserts the object {title: "c"} *twice* in collection_2.
>
> However I want only *one* insert for the second collection.
>
> The question is how to scope the FOR loop in this case? 
> Brackets are not accepted.
>
> LET array = [{title: "a"},{title: "b"}]
> FOR item IN array
>     INSERT item INTO collection_1
> INSERT {title: "c"} INTO collection_2
>
> Many thanks!
> Klaas van der Molen
>

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/arangodb/e5f06d36-b31a-461b-aa90-5bfc831c1283n%40googlegroups.com.

Reply via email to