fabricio
01/21/2018, 9:56 AM@Document(collection = "schedules")
data class ScheduleDocument(val payload: Payload) {
}
is stored as:
{
"_id" : ObjectId("5a636f2e5017622fc0c4654a"),
"_class" : "example.Payload",
"channel" : "push",
"schedule" : ISODate("2018-01-20T16:32:46.535Z")
}
But I was expecting payload
to be a subdocument, like this:
{
"_id" : ObjectId("5a636f2e5017622fc0c4654a"),
"_class" : "example.ScheduleDocument",
"payload": {
"channel" : "push",
"schedule" : ISODate("2018-01-20T16:32:46.535Z")
}
}
can anyone explain this behavior?nfrankel
01/21/2018, 10:46 AM