Today I'm experiencing an issue with Firebase to make a query such as: "Give me all the items of a user having that specific UID (user unique id)"
The items are added using the push method which creates a Unique ID. Is there some way to bypass the Unique ID for such a request?
Any help would be higly appreciated.
Thanks a lot in advance,
Current code:
//New firebase instance
Firebase mFirebase = new Firebase(Constants.FIREBASE_ITEMS_URL);
//Query on records to find items related to users only
mQuery = mFirebase.child(uid).orderByChild(uid).equalTo(uid);
mQuery.addChildEventListener(new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
getUpdates(dataSnapshot);
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String s) {
getUpdates(dataSnapshot);
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
getUpdates(dataSnapshot);
}
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String s) {
getUpdates(dataSnapshot);
}
@Override
public void onCancelled(FirebaseError firebaseError) {
Log.i(LOG_TAG, String.valueOf(firebaseError));
}
});