SensorData
allows capturing values which come with a timestamp (time
) and a name
. While this mostly a standard definition, pay special attention to the annotations on the time
property: objectbox:id-companion, date-nano
tells ObjectBox that this is a time series enabled type. Also note that we are using nanosecond resolution (specifying date
instead of date-nano
would result in millisecond resolution). OK, this is all it needs to get the generator started:time
property is absent and thus is automatically assigned to the current time. Of course, you can initialize time
beforehand if e.g. the sensor offers a timestamp. Also, you like in standard ObjectBox, we did not assign an ID as this is done for you.