I have been using firebase for quite some time now and have hit a strange road block while trying to accomplish this query:
Here is what the node looks like in my DB:
Parent
Item
- effects
effect1: "effect1"
effect2: "effect2"
effect3: "effect3"
effect4: "effect4"
I am trying to perform the following query to return all Items with a specific effect, let's say we want all Items that have effect3 in the effects node:
export const filterByEffect = (effect3) => {
return (dispatch) => {
firebase.database().ref('/strains')
.orderByChild('effects')
.equalTo('effect3')
.on('value', snapshot => {
dispatch({ type: STRAIN_FILTER, payload: snapshot.val() });
});
};
};
I am getting null... I have never had a problem querying like this although it has always been for a specific string that isn't in an object structure... I appreciate any feedback and guidance!
Cheers.