Angularfire2数据库如何将equalTo()用于数组?

时间:2018-08-03 18:38:53

标签: typescript firebase-realtime-database angularfire2

DB structure

outDoorFeatures ={ Belcony , Elevator, Garden}
for (let _i = 0; _i < outDoorFeatures.length; _i++) {
  const outDoorFeatures = this.db.database.ref( 'NewYork' )
    .orderByChild( 'outDoorFeatures' ).equalTo( outDoorFeatures [ _i ] ) 
    .on('value', function (snapshot) { 
      console.log(snapshot.val()); 
      snapshot.forEach(function (data) { 
        console.log(data.key); 

      }); 
    }); 
}

我需要显示所有存储在数据库中的信息,并使用诸如key1,area2和area3之类的键来表示。

0 个答案:

没有答案