Skip to content
Guido Barbaglia edited this page May 27, 2015 · 3 revisions

The service can be consumed through a DELETE call to WDS and it is possible to delete multiple rows/documents at once.

Parameter: "collection"

This parameter is used to specify the name of the collection, for MongoDB and OrientDB databases, or the name of the table, for SQL databases. New resources will be created in the specified collection/table.

Parameter: "payload"

The payload is the same for every DBMS and it consists of an object containing the delete query.

{
   "query": "DELETE FROM my_table WHERE AreaName = 'Italy'"
}

Full Example

$.ajax({
                        
   type: 'DELETE',
   url: 'rest/crud',
   data: {
      payload: {
         "query": "DELETE FROM my_table WHERE AreaName = 'Italy'"
      },
      datasource: "my_datasource",
      collection: "my_collection",
      outputType: "object"
   },
                        
   success: function (response) {
      /* Do something with the output... */
   },
                        
   error: function (a) {
      alert(a.responseText);
   }

});

Clone this wiki locally