orderByChild and equalTo breaks for an unknown reason
See original GitHub issueHello again 😃
The below example works for me (it returns goals where uid is my id), but it does not work for other users - for others it returns { "my_id": null }
where my_id
is 8ias7814o24j...
@connect((state) => ({
goals: helpers.dataToJS(state.firebase, 'goals'),
}))
@firebaseConnect((props) => ([
`/goals#orderByChild=uid&equalTo=${ props.uid }`,
]))
However, this hand made query returns the list of objects as expected.
this.props.firebase.ref('goals').orderByChild('uid').equalTo(this.props.uid).once('value').then(snapshot => {
console.log('Here');
console.log(snapshot.val());
}),
So I suspect that somewhere must be a bug. Appreciate your help 😉
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
orderByChild and equalTo not working with string like “+123”
Firebase Realtime Javascript SDK : orderByChild and equalTo not working with string like “+123” ... No worries, glad that you got it sorted....
Read more >Use conditions in Realtime Database Security Rules - Firebase
In this example, we're using the $other variable to declare a .validate rule that ensures that widget has no children other than title...
Read more >Collection Queries with Firebase
See how you get just the top-level keys? This is the only way to query Firebase data that does not return entire objects....
Read more >Firebase Database Query | OrderBy - YouTube
orderbychild #orderbyvalue Easy Tutorial on Firebase Database Query.
Read more >Firebase Realtime Database Rules Tutorial For Beginners
In this case, a user can read data from the users node only using the orderByChild('age') ordering function and the isEqual(37) querying ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Repo: https://github.com/DeividasK/my-future-ai Project page: https://tgoals.com Login and go through tutorial and at Step 1 when you add your goals and refresh a page you can check the console for responses. You can see this issue when the response from goals is
This is the specific container wrapper that I’m referring to: https://github.com/DeividasK/my-future-ai/blob/master/app/containers/tutorial/wrapper.js
In case this happens to others, this was something to do with the database. I have removed the user, for whom this was not working, and the data associated with the user. Then I signed up with the same user and it worked as expected.