forEach

open override fun forEach(action: (Document) -> Unit)(source)

Executes action for each document returned by this query.

This method streams all returned elements into the action function. The entire response is not loaded at once into memory.