I have a collection where the documents are like this (in MongoDB):
{
_id: 'ABPS1001',
Marca: 'DecNag',
serial: '2393-829-109',
resumen: [
{
estado: '1',
nombresAg: 'Gina',
apellidosAg: 'Saenz',
coordinador_id: '1025',
fechaMov: '25-10-2016 11:33'
},
{
estado: '0',
tecnicoID: '11',
coordinador_id: '1025',
fechaMov: '30-10-2016 16:29',
idReemplazo: 'ABPS1026'
},
{
estado: '1',
nombresAg: 'Diana',
apellidosAg: 'Gutierrez'
coordinador_id: '1014',
tecnico: '10',
fechaMov: '04-11-2016 09:12'
},
{
estado: '0',
tecnicoID: '12',
coordinador_id: '1014',
fechaMov: '30-11-2016 16:25',
idReemplazo: 'ABPS1021'
},
{
estado: '1',
nombresAg: 'Laura',
apellidosAg: 'Diaz',
coordinador_id: '1012',
tecnico: '11',
fechaMov: '04-12-2016 11:33'
},
{
estado: '0',
tecnicoID: '10',
coordinador_id: '1012',
fechaMov: '22-12-2016 12:21'
},
{
estado: '1',
nombresAg: '172.27.48.125',
apellidosAg: ''
coordinador_id: '1004',
tecnico: '12',
fechaMov: '27-12-2016 08:30',
idReemplazo: 'ABPS1035'
},
{
estado: '0',
tecnicoID: '11',
coordinador_id: '1004',
fechaMov: '02-02-2017 14:12'
}
]
}
I need to get the last "summary" entry of the document with _id: 'ABPS1001' and not the entire object. Is there any way to do it with the MongoDB statements instead of processing it with the programming language?
Thanks in advance.