I attempted to use an 'OR' ||
statement in the equalTo()
method, but this does not seem to work. Do I have to make a separate call for each value or is there a way to make conditional queries in firebase?
export const startSetContent = () => {
return (dispatch, getState) => {
const ref = database.ref("content");
return ref
.orderByChild("category")
.equalTo('one-act-play' || 'ten-min-play' || 'full-length-play')
.once('value')
.then(snapshot => {
const content = [];
snapshot.forEach(childSnapshot => {
content.push({
id: childSnapshot.key,
...childSnapshot.val()
});
});
dispatch(setContent(content));
});
};
};