i need to delete a child, What I am looking for is erasing, in order of time,
Example, i the user select "PostDuration" 3Days , I need the post to be deleted in the selected duration
the uid method:
public static String getUid() {
String path = FirebaseDatabase.getInstance().getReference().push().toString();
return path.substring(path.lastIndexOf("/") + 1)
My childs that containt the data its generated by this method:
FirebaseUtils.getPostRef().child(FirebaseUtils.getUid).setValue(mPost);
the ref:
public static DatabaseReference getPostRef() {
return FirebaseDatabase.getInstance()
.getReference("posts");
}
my Database structure