๐ฆธ Simplify the books array in the authors collection
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.
We want to modify the authors collection so the array of books include just the bookId
.
- On the MongoDB diagram view, click the
authors
collection. - On the relational mappings list on the right, click on the edit icon of
author_book
. - Edit the field name from
authorBooks
to justbooks
. - In the list of fields, uncheck
authorId
, leavingbookId
checked. - In the mapping rule's advanced settings, Check
create array of primitive values
. - Click
Save and close
.
