node-restful-api-tutorial icon indicating copy to clipboard operation
node-restful-api-tutorial copied to clipboard

Mongoose Error while Posting Order

Open Tapudp opened this issue 7 years ago • 0 comments

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

Tapudp avatar Mar 22 '18 18:03 Tapudp