Realtime Database Returns Different Data Same Child Location #7995
Unanswered
ntountasakis
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
{ "userInfo": { "user123": { "firstName": "Billy", "lastName": "Bob" }, "user456": { "firstName": "James", "lastName": "Jimmy" } } }
I have a database that looks like the one above. I have a widget that shows you rows of all users, and it does so by getting a stream from userInfo/ . For each of those row entries you can click on them and be directed to the user's profile page. When loading the profile page, I make a get call with the path to the child "userInfo/user123". Unexpectedly this call returns a map of all the children under userInfo.
What's even more bewildering is at an earlier point in the app I made this same request and it returned the data as I expected {"firstName": "Billy", "lastName": "Bob"}.
Is this interaction with a stream to the parent and a call to one of its children legal? I hope this example isn't too confusing, I thought it would be easier to discuss a concrete example versus the issue in the abstract.
Any help on this matter would be unbelievably appreciated. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions