remove/unset field

3 posts, 1 answers
  1. Francesco
    Francesco avatar
    10 posts
    Member since:
    Jun 2015

    Posted 19 Jul Link to this post

    Hi,

    is there a way to remove/unset a field from DB?

    If i remove a field in the content type structure (Edit Structure), these fields remain and appear under label: "Fields that are not defined in the structure".

    I checked the API documentation but I found nothing for this.

    Thanks,

    Francesco.

  2. Answer
    Dimitar Dimitrov
    Admin
    Dimitar Dimitrov avatar
    26 posts

    Posted 19 Jul Link to this post

    Hi Francesco,

    The desired functionality is indeed possible, but no mentioned in the docs at the moment. You just have to issue an update request to your content type with the following body:

    PUT: https://api.everlive.com/v1/Your_Api_Key/Your_Content_Type
    Body:
    {
       "$unset": {"my-field-name": "" }
    }

    This request will remove the field "my-field-name" from all items. You can also specify a filter in order to remove the field only from items that match a certain condition (using the X-Everlive-Filter header or the filtering methods in each SDK).  

    Additionally if you want to have the field completely removed, you have to delete it from your content type structure as well.

    Hope this information will help you.

    Regards,
    Dimitar Dimitrov
    Telerik by Progress
     
    Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
     
  3. Francesco
    Francesco avatar
    10 posts
    Member since:
    Jun 2015

    Posted 20 Jul in reply to Dimitar Dimitrov Link to this post

    Hi Dimitar and thanks for your help.
    I've tested (with Postman) your solution, it works fine.

    Thanks,
    Francesco

Back to Top