Skip to content

Kotlin BSON • Pure Kotlin Multiplatform implementationopensavvy.ktmongo.bson.multiplatformBsonArrayeager

eager

fun eager()

Scans this entire array recursively to find all the fields.

By default, BsonArray lazily scans for items. This is particularly beneficial if there is more data than you are interested in. However, this means the reader may discover items as it is being used, which is not thread-safe.

Instead, you can call this function to force a scan of the entire hierarchy. After this function returns, reader and all the values returned by it are thread-safe and immutable.