Thanks to the magic of embedded documents, we can avoid complicated join operations.
Yet, I find myself needing to extract all fields on a single level for creating lists or reports.
Is there a straightforward way to achieve this?
For example; I wish to generate a report including all the mentioned fields. In order to do so, I must flatten the JSON data structure.
{
"_id": "1",
"date" : "2014-07-30 02:00",
"personnel_id": "14",
"personnel_name": "xxxx Stackton",
"personnel_city": "nevercity",
"personnel_province": "neverland",
"customer_id": "473",
"customer_name": "xxxx Jordan",
"payment_method": "cash",
"payment_amount": "67.40"
}