I'm able to get the data for a particular value in the child using orderByChild
and equalTo
(cool that it works for nested child as well)
private void getData() {
try {
final DatabaseReference database = FirebaseDatabase.getInstance().getReference();
database.child(Constants.TABLE_TASKS).orderByChild("user/id")
.equalTo("somevalue")
.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
Timber.d(dataSnapshot.toString());
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
} catch (Exception ex) {
ex.printStackTrace();
}
}
Is there an easy way to get the data where a particular value is not found, basically something like a notEqualTo("somevalue")
?