Am a beginner in mongoDB. I have two collections Book and author. [name and workswritten] are the common column respectively. Using inner join I have to emit the some columns in
The mongodb is not relational database -- so it is not possible to any kind of joins here. Joins is hard to scale.
The common way in mongodb to achieve join is data denormalization. In your case you could denormalize author name into book table. Then your query will not require join. This is schema example:
book
{
_id,
name,
editions,
characters,
author_name
}
Keep in the mind that you will need to update author_name
in books collection each time when you update author collection.
Another solution -- additional request for name of author for each book, but it will work much slower.