Skip to content

Mongoose Error while Posting Order #4

@Tapudp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions