Kotlin BSON • Based on the official MongoDB implementation • opensavvy.ktmongo.bson.official.types • Jvm
Jvm¶
fun ObjectIdGenerator.Companion.Jvm(): ObjectIdGenerator
An ObjectIdGenerator instance that uses the Java driver's org.bson.types.ObjectId's algorithm.
This generation algorithm is slightly different from ObjectIdGenerator.Default. Here are a few differences:
- Maximum number of ObjectId per second ≈16 million ≈1 billion billion
- Random source
java.security.SecureRandom
kotlin.random.Random
- Testability None Can inject a clock and a random source to deterministically generate tests