The employee collection would be flattened into a relational table with the following structure:
_ID
NAME
MANAGER_NAME
MANAGER_EMAILS_0
MANAGER_EMAILS_1
pdn313
Charlotte
Robert
bob@email.com
robert@email.com
All fields are retained as separate columns in the resulting relational table. Simple types such as _id and name correspond directly to columns. In turn, subdocuments are flattened into columns using the <objectname>_<fieldname> pattern. Next, the emails array is flattened into two columns, using an extended version of the <arrayname>_<arrayindex> pattern: <objectname>_<arrayname>_<arrayindex>.
Note: As subdocuments or arrays are discovered at deeper and deeper levels, the <objectname>_<fieldname> or <arrayname>_<arrayindex> pattern is extended, for example, <objectname>_<objectname>_<fieldname>.