📜  转换为 ObjectId 的值失败 - Javascript 代码示例
📅  最后修改于: 2022-03-11 15:02:06.435000             🧑  作者: Mango
代码示例2
import mongoose from "mongoose";
// add this inside your route
if( !mongoose.Types.ObjectId.isValid(id) ) return false;