I would think the most efficient way to do this is by using an array to define the list of keys. The array could be another collection, a static array, or even a bindVariable.
Here's an example, retrieving a few documents from the list of collections:
LET keys = [ '_apps', '_fishbowl', '_jobs', '_routing' ]
FOR c IN COLLECTIONS()
RETURN c
The biggest caveat here is to make sure the filter clause is covered by an index. I'm using "
c.name" here, which is NOT indexed (this list is pretty small), but "_key" is always indexed, so you should be OK.
Using this pattern, you could also write your query like this:
FOR doc IN myCollection
FILTER doc._key in [ '1', '2, '3' /* etc. for 997 more keys */ ]
RETURN doc
Or this:
FOR doc IN myCollection
FILTER doc._key in @keys /* @keys is bound at runtime to your array */
RETURN doc