Populating Book's Authors as "author": {} and "coauthors": [], Based on Queried Author Name

Hi, everyone.

Rather than looking for a solution outright, I’m looking for pointers of what to read up on to achieve my goal. As it stands, I’m not sure where to start.

Scenario:

My models are Book and Author.

As a user, I am able to:

  • Search for books written by a given author.
  • Retrieve a book result with queried author as its author.
  • Populate authors that don’t match query as co-authors.

Example:
A Graphic Approach to College Algebra

  • User searches for Books where “John Hornsby” is the Author.
  • User retrieves “A Graphical Approach to College Algebra” as a Book.
  • The “author” field of the book is a reference to John Hornsby because his name was queried.
  • The “coauthors” field is populated based on the number of authors in the Book and maps to an array containing references to Marge Lial and Gary Rockswold, whose names don’t match the queried author name.

What concepts and keywords would assist me in achieving this?

Hi @Allen_Woods ,

I am not sure I fully understand the question. Are you looking for a possible schema according to our best practices to store similar information to the provided web page?

Or you just interested in what are the main questions/considerations you need to have when approaching a design for such an application?

Meanwhile here is a good place to start exploring:

Ty
Pavel

1 Like