0

Here is the exported JSON from my Firebase Database:

{
  "users" : {
    "115737970494961514401" : {
      "createDate" : {
        "date" : 5,
        "day" : 1,
        "hours" : 15,
        "minutes" : 19,
        "month" : 11,
        "seconds" : 32,
        "time" : 1480972772566,
        "timezoneOffset" : 360,
        "year" : 116
      },
      "email" : "wang.zhexi@gmail.com",
      "fName" : "Michael",
      "lName" : "Wang"
    }
  }
}

Is there any way I can look for the specific key of 115737970494961514401? I am developing in Android Studio.

AL.
  • 36,815
  • 10
  • 142
  • 281
Michael
  • 311
  • 4
  • 22

1 Answers1

1

You should do something like how it was answered here

Yours would look something like this:

DatabaseReference usersRef = FirebaseDatabase.getInstance().getReference().child("users);
usersRef.addListenerForSingleValueEvent(new ValueEventListener() {
  @Override
  void onDataChange(DataSnapshot snapshot) {
    if (snapshot.hasChild("some unique id")) {
      // run some code to add user
    }
  }
});
Community
  • 1
  • 1