Kotlin BSON • Pure Kotlin Multiplatform implementation • opensavvy.ktmongo.bson.multiplatform • Bson • eager
eager¶
fun eager()
Scans this entire document recursively to find all the fields.
By default, Bson lazily scans for fields. This is particularly beneficial if there is more data than you are interested in. However, this means the reader may discover fields 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.