I'm not sure if I'm doing this right but I'm creating a Query to get the auto-generated key that is stored in firebase. I want to delete this key from firebase. I'm wondering if this the right process? Like is it possible to just call removeValue() on the query or have to use Datasnapshot? My code is as follows. All it does is gets the auto-generated key and prints it.
DatabaseReference ref = FirebaseDatabase.getInstance().getReference();
String removeQuery = ref.child("EventData").push().getKey();
System.out.println(removeQuery);
Log.d(TAG,"Remove Query was called !!!!!!!!!!!!");
Updated2
Is there an easy way to set removeQuery to null?
