'DELETE operation javascript fetch() with REST API firebase
I use the following API request in order to delete all texts (so called cps) of one section (one section contains many cps)
await fetch(`https://12345-default-rtdb.europe-
west1.firebasedatabase.app/cps/${userId}.json?section_id=${mysection}`,{method:'DELETE',
// });
userId is correct, mysections is the current sectionId, section_id is the key of the sectionId in the JSON document. (eg: -N09gWdyQlV7OsPpEx7t or -N09g_HjbcFCQFBiIX0A see below) In this example all cps of all sections are being deleted. So the conditional query does not work.
What is going wrong here? Thanks!
The tree within firestore looks like this:
cps -> user1 -> -N09gWdyQlV7OsPpEx7t
cps -> user1 -> -N09g_HjbcFCQFBiIX0A
....
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
