๐ฆธ 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
users
collection. - Click on the edit edit icon of
user_addresses
Embedded array. - Change the field name from
userAddresses
toaddresses
. - Deselect
id
,userId
andcityId
. - Click
Save and close
- Click on the edit edit icon of
cities
, which is an embedded document inside the arrayaddresses
. - Deselect
id
andcountryId
. - Rename the
name
field 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
countries
as Source table. - In the advanced settings check
Merge fields into the parent
. - Only check
name
field, renaming thename
field intocountryName
. - Click
Save and close
.