Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad request about DELETE #11

Open
ghost opened this issue Apr 25, 2016 · 1 comment
Open

Bad request about DELETE #11

ghost opened this issue Apr 25, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 25, 2016

Hi,

When I do a delete using explorer, the curl request is :

curl -X DELETE --header "Accept: application/json" "https://domain.com/api/items/AVRN9YTgQpzsefUO2miC"

This fail with :

{
  "error": {
    "name": "TypeError",
    "status": 500,
    "message": "self.db.deleteByQuery is not a function",
    "stack": "TypeError: self.db.deleteByQuery is not a function\n    at destroyAll (/opt/development/node_modules/loopback-connector-es/lib/esConnector.js:796:13)\n    at doDelete (/opt/development/node_modules/loopback-datasource-juggler/lib/dao.js:1740:19)\n    at /opt/development/node_modules/loopback-datasource-juggler/lib/dao.js:1714:11\n    at doNotify (/opt/development/node_modules/loopback-datasource-juggler/lib/observer.js:93:49)\n    at doNotify (/opt/development/node_modules/loopback-datasource-juggler/lib/observer.js:93:49)\n    at doNotify (/opt/development/node_modules/loopback-datasource-juggler/lib/observer.js:93:49)\n    at doNotify (/opt/development/node_modules/loopback-datasource-juggler/lib/observer.js:93:49)\n    at Function.ObserverMixin._notifyBaseObservers (/opt/development/node_modules/loopback-datasource-juggler/lib/observer.js:116:5)\n    at Function.ObserverMixin.notifyObserversOf (/opt/development/node_modules/loopback-datasource-juggler/lib/observer.js:91:8)\n    at Function.ObserverMixin._notifyBaseObservers (/opt/development/node_modules/loopback-datasource-juggler/lib/observer.js:114:15)\n    at Function.ObserverMixin.notifyObserversOf (/opt/development/node_modules/loopback-datasource-juggler/lib/observer.js:91:8)\n    at Function.ObserverMixin._notifyBaseObservers (/opt/development/node_modules/loopback-datasource-juggler/lib/observer.js:114:15)\n    at Function.ObserverMixin.notifyObserversOf (/opt/development/node_modules/loopback-datasource-juggler/lib/observer.js:91:8)\n    at Function.ObserverMixin._notifyBaseObservers (/opt/development/node_modules/loopback-datasource-juggler/lib/observer.js:114:15)\n    at Function.ObserverMixin.notifyObserversOf (/opt/development/node_modules/loopback-datasource-juggler/lib/observer.js:91:8)\n    at /opt/development/node_modules/loopback-datasource-juggler/lib/dao.js:1712:15"
  }
}

But if I execute the right request directly to elasticsearch, it's ok and this is the request :

curl -XDELETE 'http://localhost:9200/items/item/AVRN9YTgQpzsefUO2miC'

Reference : Delete API

Thanks

@pulkitsinghal
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant