Skip to content
This repository has been archived by the owner on Feb 22, 2019. It is now read-only.

Commit

Permalink
Changed deleteSpecifications return type
Browse files Browse the repository at this point in the history
  • Loading branch information
samniisan committed Jun 15, 2017
1 parent 335be5f commit 3d39a27
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/sdk-reference/collection/delete-specifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ title: deleteSpecifications
// Deleting specifications using callbacks (NodeJS or Web Browser)
kuzzle
.collection('collection', 'index')
.deleteSpecifications(function (err, deleted) {
.deleteSpecifications(function (err, res) {
// callback called once the delete action has been completed
});

// Deleting specifications using promises (NodeJS)
kuzzle
.collection('collection', 'index')
.deleteSpecificationsPromise()
.then(deleted => {
.then(res => {
// promises resolved once the delete action has been completed
});
```
Expand All @@ -31,9 +31,9 @@ kuzzle
// Deleting one document
kuzzle
.collection("collection", "index")
.deleteSpecifications(new ResponseListener<Boolean>() {
.deleteSpecifications(new ResponseListener<JSONObject>() {
@Override
public void onSuccess(Boolean deleted) {
public void onSuccess(JSONObject result) {

}

Expand All @@ -54,7 +54,7 @@ $dataCollection = $kuzzle->collection('collection', 'index');

// Deleting one document
try {
$deleted = $dataCollection->deleteSpecifications();
$result = $dataCollection->deleteSpecifications();
}
catch (ErrorException $e) {

Expand All @@ -64,7 +64,9 @@ catch (ErrorException $e) {
> Callback response:
```json
true
{
"acknowledged": true
}
```

Delete specifications linked to the collection object.
Expand Down Expand Up @@ -92,9 +94,3 @@ Delete specifications linked to the collection object.
## Return value

Returns the `Collection` object to allow chaining.

---

## Callback response

Resolves to a boolean confirming the success of the delete action.

0 comments on commit 3d39a27

Please sign in to comment.