Reputation: 71
I am trying to store my survey results data in the firebase database. I have structured it as the following: organization_id > survey_id > user_id > question_id : choice_id
Example : 2:organization_id, 25: survey_id, 225: user_id, 101: question_id, 1/2/3/4/5: choice_id
I want to show how many users selected a particular choice for a question. Expected result
Upvotes: 1
Views: 804
Reputation: 1285
You are probably going to want another node that keeps the number of choices selected per question. Something like:
org_id > survey_id > question_id > totals > choice1: numberResponses
> choice2: numberResponses
Its common to have to store the same data in a different format depending on how your application will use it.
Upvotes: 1