In my Firebase I have a entry called 'status' which has some records as 'active' and others as 'inactive'. I am trying to return all records that have the status of 'active'. I am doing the following statement.
new Firebase($rootScope.constants.firebase)
.startAt('active')
.endAt('active')
.once('value', function(snap){
console.log(snap.val());
});
However this is returning NULL.
I am adding data to firebase in the following way:
$firebase(ref).$add({
date: Firebase.ServerValue.TIMESTAMP,
status: 'active'
})
My firebase data looks like the following:
{ "-JSex4_si4a2ZMOLcEuj" : {
"date" : 1406248704619,
"status" : "active",
},
"-JShWyGQzDtAl-F8EkOI" : {
"date" : 1406291928576,
"status" : "active",
}}
Please can someone explain why I am getting NULL and how to get all records with this 'active' status?