Here's a link to:
So, my question is, I want to filter the articles by their type (i.e. "news," or "voice"), and then order those articles by the date that they were published (YYYY-MM-DD). So far, I have written the code:
var news = firebase.database().ref().child('articles').orderByChild('type').startAt('news').endAt('news');
news.orderByChild('date').on('value', function(snapshot) {
console.log(snapshot.val());
});
(Sorry for the snippet, the equals sign was messing with the formatting)
The console then gives me the error:
Uncaught Error: Query.orderByChild: You can't combine multiple orderBy calls.
Is it possible to do what I'm trying to do, or do I have to find something else?