This is my code to add new object in firebase.
private void addProductVariant(String pid, String vid, String mrp, String sellPrice) {
    final String uid = getUid();
    String key = databaseReference.child("shops-product-list").child(uid).push().getKey();
    ShopProductVariant shopProductVariant = new ShopProductVariant(pid, vid, mrp, sellPrice);
    Map<String, Object> shopProductVariantValues = shopProductVariant.toMap();
    Map<String, Object> childUpdates = new HashMap<>();
    childUpdates.put("/shops-product-list/" + uid + "/"+ key, shopProductVariantValues);
    databaseReference.updateChildren(childUpdates);
}
This works fine.
Now i want to delete the same object. i don't know the location (full url). This is code i have written so far.
private void deleteProductVariant(String pid, String vid, String mrp, String sp){
    final String uid = getUid();
    ShopProductVariant shopProductVariant = new ShopProductVariant(pid, vid, mrp, sp);
    //databaseReference.child("shops-product-list").child(uid).child("product-list").setValue(shopProductVariant);
    //mDatabase.child("users").child(userId).child("username").setValue(name);
}
How to get key value and delete data object on that location?