I have many records of Collection.
Collection = [
{item: 'A', date: '2018-07-01', qtybalance: 100},
{item: 'A', date: '2018-07-02', qtybalance: 70},
{item: 'A', date: '2018-07-03', qtybalance: 150},
// .................Many of A..............
{item: 'B', date: '2018-07-01', qtybalance: 100},
{item: 'B', date: '2018-07-02', qtybalance: 70},
{item: 'B', date: '2018-07-03', qtybalance: 120},
// ...............Many of B...............
]
I would like to get last record for Item
(Distinct) as at 2018-07-03
with Performance
like Collection Index
.
My result expected (2 records)
{item: 'A', date: '2018-07-03', qtybalance: 150},
{item: 'B', date: '2018-07-03', qtybalance: 120},
Please help me for Collection Query???