Function does not return the UID - Firebase

0

I'm developing an app with ionic 3 and firebase, and I'm encountering a problem, because the function I'm calling is not working as expected. I wanted it to return only the requests with this uid

getAll() {
var userId = firebase.auth().currentUser.uid
console.log(userId);
return this.db.list('pedidos', ref => ref.equalTo(userId))
  .snapshotChanges()
  .map(changes => {
    return changes.map(c => ({ key: c.payload.key, ...c.payload.val() }));

  })

}

    
asked by anonymous 20.09.2018 / 20:36

0 answers