If nested property query is using, this is always returning null, I have no ideas why, just following offcial website document document link
database.getCollection<User>().findOne(User::auth / Auth::ssaid eq p.ssaid, User::auth / Auth::password eq p.password)
no nested property query it is all fine.
database.getCollection<User>().findOne(User::lastlogin eq p.lastlogin)
model class code
data class Auth(val password: String, val ssaid: String, val localLastLogin: String)
data class User(
@BsonProperty(useDiscriminator = true) val auth: Auth,
val lastLogin: String = Instant.now().toString(),
val members: List<Member> = emptyList(),
val channels: List<Channel> = emptyList()
) : Data()