Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Cast to ObjectId failed for value

// my problem is caused by path "/:params"
router.get("/:params", async (req, res) => {})

// can solve it as follows
router.get("/add-some-path/:params", async (req, res) => {})
// or
router.get("/:params/add-some-path", async (req, res) => {})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Cast #ObjectId #failed
ADD COMMENT
Topic
Name
5+5 =