-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Unable to remove document #4320
Comments
So in mongoose, calling As an aside, IMO you're abusing express middleware. I'd recommend reading @rauchg 's (original author of mongoose, socket.io, and now) excellent comments on the subject: vercel/micro#8 (comment) |
Thanks! The docs were just a littler unclear to me. Could you elaborate on how I am abusing middleware. I understand the article but not how it pertains to my case. |
Adding properties to |
I am having trouble removing a document from a collection in an express-based REST API. The delete route code and relevant router.param is here:
The
:tID
is the ID for threads and the:cID
is the ID for comments on those threads. When I hit the route with a request using postman, I see 'trying to remove' logged, but never 'removed' or a HTTP response. It just hangs without even an error being triggered. This is a gist with mymodel.js
file if it is necessary for debugging. I have tried usingremove()
withexec()
andthen()
but it still isn't working. I find the docs to be confusing with removing documents. I really do hope it isn't an obvious mistake, but I have been looking through the docs and bug fixing for an hour or more. Thanks for the help, CJ.The text was updated successfully, but these errors were encountered: