2017-02-14 7 views
0

나는 어떤 생각이 왜 내 데이터베이스 child number > 7중포 기지 orderByChild받지 결과

this.extra = function() { 
    refer = ref.child(slot); 
    refer.orderByChild('number') 
     .startAt('7') 
     .once('value') 
     .then(function (snapshot) { 
      console.log(snapshot.key()); 
     }); 
} 

을 가지고 모든 날짜를 얻을 수를 조회하려고하지만 널 (null) 결과는 무엇입니까?

A look at firebase database

답변

1

당신은 (따옴표) '7'를 전달하고 있지만, 값이 (따옴표없이) 7로 저장했다. 즉, 문자열과 숫자를 비교하는 것이므로 효과가 없습니다.

대신 이것을 사용 : 알았어요!

ref.child(slot) 
    .orderByChild('number') 
    .startAt(7) 
    ... 
+0

감사합니다 .. –

관련 문제