1

Apologies if duplicated

I have a database set up in the following way:

- users
    - <random user id>
        - Projects
            - <random project id>
                - data

What I would like to do is: get all users where the 'Projects' node exists and where <random project id> is equal to a specific value, without getting the entire database and filtering the data inside my react-native application, because it seems wrong to just bring everything. I heard that it is possible to 'reverse engineer' react-native applications, and I fear that someone might listen the app requests and somehow get access to all that data, so I would like to bring only the data that belongs to a specific user.. if possible.

Today, I simply get all the data by using firebase.database().ref('Users').on('value', ...);
I could filter that data inside my app, but, as I said, I have security concerns..

But since I'm new to this, I could be looking at this with a wrong perspective, so I appreciate any help!

Thanks!

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Matheus
  • 79
  • 8
  • 1
    A Firebase query can have exactly one level of unknown keys and you have two. You cannot search across all users and all their projects. See https://stackoverflow.com/questions/27207059/firebase-query-double-nested – Frank van Puffelen May 27 '20 at 20:49
  • @FrankvanPuffelen I see.. perhaps I should restructure the way my database is setup. Thank you! – Matheus May 28 '20 at 11:32

0 Answers0