Jvm
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:
| ObjectIdGenerator.Jvm | ObjectIdGenerator.Default | |
|---|---|---|
| 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 |