Skip to content

Mongoose Error while Posting Order #4

Description

@Tapudp

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions