jvm MongoDB driver for Kotlin (synchronous) • opensavvy.ktmongo.sync • MongoIterable • forEach forEach¶ abstract fun forEach(action: (Document) -> Unit) 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.