-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Description
I have a project using mongodb-panache-kotlin extension to manipulate data in a MongoDB. We follow the repository pattern as presented in the documentation, using Kotlin data classes.
The documentation found here states that the Kotlin data classes representing Mongo Entities can use either val
or var
for the properties.
But I noticed that when using val
, the Mongo driver returns an object with null
values for every properties.
I have a project to reproduce the issue here : https://github.com/loriepisicchio/mongo-panache-kotlin
You can run UserMedicalStudyPanacheRepositoryTest
as integration test. You will see the tests failing because the object properties are null
.
If you change val
s into var
in UserMedicalStudyEntity
, the tests will pass.
Let me know if you need more information.
Implementation ideas
No response