Delete Relation using condition¶
The API deletes objects from a relationship with their parent. The objects are identified implicitly through a
xxxx.backendless.app is a subdomain assigned to your application. For more information see the Client-side Setup section of this documentation.
||id of the object for which the relation with the child objects will be deleted.|
||name of the column which identifies the relation within the parent table (identified as
||a where clause condition identifying objects in the child table which will be removed from the relation to the parent object.|
||Optional header. Contains a value returned by Backendless in a preceding user Login API call. If user-token is set in the request, the operation will be executed with the security policy associated with the currently logged in user. This means all permissions associated with the user and the roles assigned to the user will be enforced by Backendless.|
Number of child objects removed from the relationship.
The following request deletes a relation between a
Person object and all the related objects in the related table (
Users) which match the provided query. The column name identifying the relation is
friends. The query is specified in the
whereClause parameter in the URL. The value of the
whereClause parameter is URL-encoded. The decoded version of the query is:
name='Joe' or name = 'Frank'. As a result of the operation, all related objects where the
name property is either Joe or Frank will be deleted from the relation.
Make sure to replace xxxx in the domain name in the sample request below to the one assigned to your application.
curl \ -X DELETE https://xxxx.backendless.app/api/data/Person/parentObjectId/friends?whereClause=name%3D%27Joe%27%20or%20name%20%3D%20%27Frank%27