馃Ω Edit mapping to authors collection (from author_book table)
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 to include an array of IDs representing their books.
- 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