Skip to content

Deleting Multiple Objects

This API deletes multiple objects in a data table with a single request. Consider the following example, it demonstrates an API call which deletes all objects in the Person data table where the value of the age property is greater than 20:

AsyncCallback<int> bulkDeleteCallback = new AsyncCallback<int>(
  objectsDeleted =>
    System.Console.WriteLine( String.Format( "Server has deleted {0} objects in the database", objectsDeleted ) );
  error =>
    System.Console.WriteLine( "Server returned an error " + error.Message );
  } );

Backendless.Data.Of( "Person" ).Remove( "age > 20",bulkDeleteCallback );

Blocking Method

int Backendless.Data.Of( "TABLE-NAME" ).Remove( String whereClause );
int Backendless.Data.Of<E>().Remove( String whereClause );

Non-Blocking API

void Backendless.Data.Of( "TABLE-NAME" ).Remove( String whereClause, 
                                               AsyncCallback<int> responder )
void Backendless.Data.Of<E>().Remove( String whereClause, AsyncCallback<int> responder )


Argument                Description
TABLE-NAME Name of the table where the objects are deleted.
E A .NET class of the data objects to delete.
whereClause A condition for selecting objects to be deleted in the data table.
responder a responder object which will receive a callback when the method successfully deleted the objects or if an error occurs. Applies to the non-blocking method only.

Return Value

The method returns the number of objects deleted in the database.