I have a firebase database that looks like this:
I have the courseID
variable stored in my $state.params.courseID
parameter, and now I want to only pull Sections
where the coursedID
matches the $state.params.courseID
variable, and then store the results in an array here is what I tried so far:
var sectionsRef = firebase.child('Sections');
sectionsRef
.orderByChild('courseID')
.on('value', function(snap) {
console.log(snap.val(), 'Sections');
console.log(snap.key(), 'Key');
});
$scope.sections = $firebaseArray(sectionsRef);
I'm really confused on how to do even basic queries like this in Firebase.