Skip to main content

๐Ÿฆธ 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 just books.
  • In the list of fields, uncheck authorId, leaving bookId checked.
  • In the mapping rule's advanced settings, Check create array of primitive values.
  • Click Save and close.
Changes in the authors collection