ποΈ π Intro
If you followed this session in person with the MongoDB team, you've learned data modeling concepts and best practices. The data you imported uses the schema presented in the session, but the code samples are querying data as if it were a relational database. In this exercise, you'll update the code to use the data model you learned about in the session.
ποΈ π Patterns Used
Let's look at the current code that is used to retrieve a single book. You can find this code in the server/src/controllers/books.ts file.
ποΈ π Optimize the Query
Now that you know of the patterns that we used in our data schema, you can rewrite the getBook method to retrieve the book information.