In the normal Mongo shell, it is possible to perform the following step during an aggregation to create an ISODate object from a Long timestamp, and therefore be able to use the various date helper functions ($year
,$month
, etc):
{
$project:{
'date': {
$add: [
new Date(0),
{
$multiply:[
'$seconds_timestamp_field',
1000
]
}
]
}
}}
Is something similar possible using Spring Data? The plus()
method does not appear to support a Java Date
object as an argument. Thanks for your help.