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

Mongoose Error while Posting Order #4

Open
Tapudp opened this issue Mar 22, 2018 · 0 comments
Open

Mongoose Error while Posting Order #4

Tapudp opened this issue Mar 22, 2018 · 0 comments

Comments

@Tapudp
Copy link

Tapudp commented Mar 22, 2018

Hello Max and all other viewers, love your videos, but in this tutorial I got stuck after implementing the router.post('/', ....), whenever I try to POST the order in postman software it comes out as

{
    "error": {
        "message": "document must have an _id before saving",
        "name": "MongooseError"
    }
}

and nothing gets posted in localhost:3000/orders

I mean why does the mongoose expect the _id to be there first, isn't the productId should suffice for that? I"m sorry if I'm vague , provide any explanation or suggestion that will help me guide

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