Instead of grouping by a constant, you can also apply a LIMIT for the same
effect:
LET array = [{title: "a"},{title: "b"}]
FOR item IN array
INSERT item INTO collection_1
LIMIT 1
INSERT {title: "c"} INTO collection_2
On Friday, May 16, 2025 at 1:47:45 PM UTC+2 mic...@arangodb.com wro
Hi,
For this particular query there are actually two more possibilities:
>> LET array = [{title: "a"},{title: "b"}]
>> FOR item IN array
>> INSERT item INTO collection_1
>> INSERT {title: "c"} INTO collection_2
Could run as:
INSERT {title: "c"} INTO collection_2
LET array = [{title: "a"},{t
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