7

Am fetching list of users for my listview (android) i used firebaselistadapter to backing up my listview , I wanna show users data except mine . Like an sql query Select something from usertable where id!=userid;

i wanna fetch all other users data,

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
sivaram636
  • 419
  • 3
  • 14

2 Answers2

9

Firebase currently only offers a way to include nodes based on the presence of a certain value. You cannot exclude nodes based on the presence of a value.

Update (20160828): I wrote a related answer today that shows how to detect the absence of a property.

Community
  • 1
  • 1
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
1

I have the same issue, using angularfire and geofire I am searching for business prospects within a radius and trying to create a lead only for new prospects, that means to exclude any existing account already with an existing relation. To do so I need to open a firebaseObject for each key returned by geofire and after $loaded() , check for _.isNull(loadedFirebaseObject.$value). The lodash function _.isNull() returns null if the firebaseObject path does not exists (a prospect) or undefined if it exists (not a prospect but an existing account).

Is there a better way of doing this?

Arup Saha
  • 179
  • 1
  • 3