DellContact=(emailcontact) => {
let {xhttp}=this.DbConn('DELETE','.json?orderBy="email"&equalTo="' + emailcontact + '"');
xhttp.send();
}
DbConn (method, addon){
let xhttp = new XMLHttpRequest();
let url = "https://phonebook-496ff-default-rtdb.firebaseio.com/Contacts" + addon;
xhttp.open(method,url,true);
xhttp.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
return {xhttp};
}
hello, im trying to delete the specific data from firebase by comparing the JSON value named "email" with the value emailcontact. i get a bad request 400. its something with the request syntax i think, because with GET/POST it works. firebaseURL/Contact.json?orderBy="email"&equalTo="[email protected]" <-- This is the request that sent Any suggestions ?
Firebase Realtime Database doesn't support update or delete queries. To delete a node, you need to know its exact path.
So you'll need to:
GET
for the query to determine the results.DELETE
request for each individual result.