How to get all the nodes irrespective of the userid

I have the below-mentioned database:-

database1

I want to get all the sub-nodes in one list irrespective of the userid they are in.
I want the list as follows:-

TO THE MOON
NEED TO WORK
(Since they are under one category - Realism)

Kindly guide me on what should I do?

1 Like

There are several recent topics about how to do this. Here’s one:

2 Likes

Thanks for your response, sir. I checked the link you provided. However, it will help me to get the details of the category displayed under 1 userid.
However, I want to get all the stories present under 1 category from all the userid available in my database in one list.
Suppose “userA” wrote “story1” under the category Drama from their login account, and “userB” wrote “Story2” under the same category drama from its own login account. Then being the third user, If I click on drama, my list should show this:-
Story1
Story2

1 Like

There is no easy way.
You have to go through a loop vetting the key values and retrieving required items.

Send the JSON file of your database and I’ll demonstrate a working looping structure.

https://drive.google.com/drive/folders/1PBiWENFW89y_fj8RDrOh3VSicHQMlE9R?usp=sharing
Link of folder containing the JSON file of the database.

I tried to use the following code but it only works if the category i.e., Fantasy, Drama, etc. is available in the first userid, then it will show the whole list irrespective of the userid, else will show nothing.

1 Like

What you attempted is right. You just need another loop inside the main loop.

What will be the value of that loop?

1 Like

See this block

This is the output

image

1 Like

Thank you for your guidance. It helped me a lot in my project. :slight_smile:

1 Like