There is no magic here. You'll have to read all users, loop over them, and then delete their points one-by-one, or through a multi-path update.
Something like:
DatabaseReference usersRef = FirebaseDatabase.getInstance().getReference("UsersExample");
usersRef.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
Map<String, Object> updates = new HashMap<>();
for (DataSnapshot userSnapshot: dataSnapshot.getChildren()) {
updates.put(userSnapshot.getKey()+"/point", null); // Setting to null will delete that node
}
userRef.updateChildren(updates);
}
@Override
public void onCancelled(DatabaseError databaseError) {
throw databaseError.toException();
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.