FILTER for entry in list of objects in AQL (ArangoDB)

Just a quick blag for my future self:
FOR row IN coll
   FOR entry in doc.array
      FILTER entry.field_name != @field_name
   LIMIT @limit
   RETURN DISTINCT doc

Didn’t give me what I wanted. While slapping DISTINCT on the RETURN fixed the problem of “I’m getting the same document over and over again” it now doesn’t return @limit many documents but seemingly a random — but lower — number. What’s actually happening here is, that the indentation is deceiving: the last two lines should be indented one more.

FOR row IN coll
    FILTER POSITION(doc.array[*].field_name , @field_name) == false
    LIMIT @limit
    RETURN doc

Is what I actually wanted.

Article Link: FILTER for entry in list of objects in AQL (ArangoDB) – nullteilerfrei