sivaram636
sivaram636

Reputation: 429

is it possible query data that are not equal to the specified condition?

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,

Upvotes: 7

Views: 7865

Answers (2)

Frank van Puffelen
Frank van Puffelen

Reputation: 598817

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.

Upvotes: 9

Arup Saha
Arup Saha

Reputation: 179

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?

Upvotes: 1

Related Questions