Skip to content

Spatial Data Delete API

There are two way to delete a spatial value from an object in the database:

  1. Using Backendless Console
  2. Using API

Deleting Data with Console

To delete a spatial value in console, simply clear out the contents of a cell and press Enter. Backendless Console confirms that the object has been updated:

record-updated-point-deleted

Deleting Data with the API

Deleting a spatial value from an object using the API is technically the object update operation with the spatial value property set to null. The example is a request which removes a value from the location property for an object in the Person table shown above. Notice the location property in the request is set to null:

Important

Make sure to replace xxxx in the domain name in the sample request below to the one assigned to your application.

curl \  
-X PUT \  
-H 'Content-Type:application/json' \  
 -d '{ \  
  "location": null \  
}' \  
'https://xxxx.backendless.app/api/data/Person/OBJECTID'

Alternatively, the same result can be achieved using the bulk update API operation. With this approach you can delete a spatial property either in a single or multiple objects. This is done with a query (the where clause) used in the API request. For example, the following query uniquely identifies a single object: objectId = 'XXX-XXX-XXX'. Consider an example demonstrating the approach:

curl -X PUT \  
  -H 'Content-Type:application/json' \  
  -d '{ "location":null }' \  
'https://api.backendless.com/APP-ID/REST-API-KEY/data/bulk/Person?where=email%20%3D%20%27bob%40thebuilder.com%27'