adamspe / odata-resource

Node.JS+Express+REST
https://www.npmjs.com/package/odata-resource
12 stars 4 forks source link

Resource.delete should use model.remove() #1

Closed adamspe closed 8 years ago

adamspe commented 8 years ago

Currently the default delete implementation uses model.remove({},callback) however when going this route the schema.post('remove',callback) hook is not invoked.

http://mongoosejs.com/docs/middleware.html documents this fact and it's working to spec.

Should instead find the document and use document.remove(callback).

adamspe commented 8 years ago

fixed in v0.1.4