Details
-
Question
-
Resolution: Works as Designed
-
Unknown
-
None
-
None
-
None
-
None
Description
Summary
Hello, I am trying to write a data class to a time series collection where the `timeField` has name 'timestamp' and is of type:
kotlinx.datetime.instant
|
I have created a codec which simply encodes
writer.writeDateTime(value.toEpochMilliseconds())
|
however in the logs I see the resulting document:
"documents": [{"timestamp": "2023-09-18T22:36:28Z", ...}] |
accompanied by the following error message:
'timestamp' must be present and contain a valid BSON UTC datetime value |
In fact, the only way I can get this to work is if I use kotlinx.serialization and provide a java instant!
I don't know if there is a driver issue here, but certainly this looks like it should work? If there is a mistake here I think it would be great if the documentation could provide a more comprehensive example!
Driver Version
4.10.1