在MongoDB中,使用findByIdAndDelete() -我试图通过使用mongoose从集合中删除一项,但它抛出了一个错误- CastError: Cast to ObjectId failedfor value "5f080dd69af4c61774ef447f " at path "_id" for model "Item" 我的Mongoose代码- app.post("/del",const delItem = req.body.de
我在服务器端有一个mongoose对象: ... name: "Test",}
// id and namedefined in model as String and Number 然后我在项目中添加新的字段提及: item.mention = [{ id: 1, ... }] 但我不能在客户端被提及。我的响应代码: res,json({ status: 1