mern_stack_course icon indicating copy to clipboard operation
mern_stack_course copied to clipboard

ValidationError: Note validation failed: user: Cast to ObjectId failed for value because of "BSONError"

Open tanvircr7 opened this issue 2 years ago • 1 comments

Cannot make a newnote because of this error ValidationError: Note validation failed: user: Cast to ObjectId failed for value "Havoc" (type string) at path "user" because of "BSONError" here a user named 'Havoc' is trying to make a new note. something to note: my database uri is different where i dont' have the database name like 'techNotesDB' as in the case of the video

tanvircr7 avatar May 30 '23 12:05 tanvircr7

Issue: ValidationError: Note validation failed: user: Cast to ObjectId failed for value "Havoc" (type string) at path "user" because of "BSONError.

Solution: Not to use a name rather have to use a user ID.

DeepeshKalura avatar Jul 21 '23 11:07 DeepeshKalura