The trick is to use set instead of push, example is below
String normalizedUserName = getNormalizedUserNameForDBPath(email);
String enterpriseRoot = normalizedUserName;
DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReference();
String pathName = APP_NAME + "/" + enterpriseRoot + "/users";
final DatabaseReference messagesRef = databaseReference.child(pathName).child(normalizedUserName);
messagesRef.setValue(userdetails);
=> Dont use push
String normalizedUserName = getNormalizedUserNameForDBPath(email);
String enterpriseRoot = normalizedUserName;
DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReference();
String pathName = APP_NAME + "/" + enterpriseRoot + "/users";
final DatabaseReference messagesRef = databaseReference.child(pathName).child(normalizedUserName);
messagesRef.setValue(userdetails);
=> Dont use push
No comments:
Post a Comment