It's simplest if you use "bookname" as your database name, and "category_name" as your collection name. Then, you can run a command to list the collections for that database (so, to list the "categories" in each "bookname") . In the shell:
> use cats_and_dogs
> show collections
white_cats
black_cats
gray_dogs
> db.gray_dogs.find()
Depending on the language driver you are using, there will probably be a command to return all the collections in a given database in a cursor.
Also, there is a page in the MongoDB docs that discusses best practices for data modeling, and it's worth checking out: http://docs.mongodb.org/manual/core/data-modeling/