Bad request sending GET request with id (ExpressJS) Bad request sending GET request with id (ExpressJS) mongoose mongoose

Bad request sending GET request with id (ExpressJS)


As MongoDB says that the default unique identifier generated as the primary key _id for a document is an ObjectId.


And it's 12-byte binary value which is often represented as a 24 character hex string.

And whenever MongoDB get less than 24 characters it does not accept that as _id. That's why you are getting some error from MongoDB side.