Deleting Data Items

Deleting Data Items

The Backend Services Android SDK allows you to delete single or multiple data items in a single method call.

Similar to updating items, you can delete either by ID or by filter.

Delete by ID

To delete an item of your type, you have to execute the following code snippet:

public void deleteById(EverliveApp app, UUID id)
{
    app.workWith().data(Book.class).deleteById(id).executeAsync();
}

Deleting Multiple Items

To delete multiple items of your type with a single operation, you have to execute the following code snippet:

public void deleteMultiple(EverliveApp app, UUID userId)
{
    app.workWith().data(Book.class).
        delete().
        Where(new ValueCondition("UserId", userId, ValueConditionOperator.EqualTo).
        executeAsync();
}

In order to delete all items from a content type, you can leave aside the filter parameter. More information about it here.

Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.