๐ฆธ Clean Users address data
info
Extra activity! Do it if you have extra time or are following along at home. It won't be covered during the hands-on lab.
The array that holds user addresses has a lot of unneeded data.
- On the MongoDB diagram view, click on the
userscollection. - Click on the edit edit icon of
user_addressesEmbedded array. - Change the field name from
userAddressestoaddresses. - Deselect
id,userIdandcityId. - Click
Save and close - Click on the edit edit icon of
cities, which is an embedded document inside the arrayaddresses. - Deselect
idandcountryId. - Rename the
namefield intocityName. - In the advanced settings, check 'Merge fields into parent`.
- Click
Save and close. - On the relational mappings list on the right, click
+Add. - Select
Embedded documents. - Select
countriesas Source table. - In the advanced settings check
Merge fields into the parent. - Only check
namefield, renaming thenamefield intocountryName. - Click
Save and close.
