Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Cast to ObjectId failed for value

import mongoose from "mongoose";

// add this inside your route
if( !mongoose.Types.ObjectId.isValid(id) ) return false;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Cast #ObjectId #failed
ADD COMMENT
Topic
Name
3+3 =