Get latest document of each unique record

We have about 300,000 unique customers. We have one document each for every order placed, so we have several million order documents since the past 3 years.

How can I get the latest order document for each unique customer's record?

{
"_id" : 1,
"customer_id" : 1001,
"order_amount" : 15.00,
"timestamp" : 1/1/2014,
},
{
"_id" : 2,
"customer_id" : 1001,
"order_amount" : 17.00,
"timestamp" : 1/1/2015,
},
{
"_id" : 3,
"customer_id" : 1002,
"order_amount" : 13.00,
"timestamp" : 1/1/2016,
}

I need the output to be records _id - 2 and 3. Is this possible at all?

Maybe parent/child? Index one parent document for each customer, and a child document for each order that customer has? But then I'm unsure at query time how to only retrieve e.g. the top 2 children per parent ... maybe using top hits aggregation, sorting by timestamp descending, keeping the top 2.

Mike McCandless