需要对 id 进行转换
const mongoose = require(‘mongoose‘)
var ObjectId = mongoose.Types.ObjectId;
await Users.aggregate([
{
$match : { "_id":new ObjectId("5asdasdasc66b6aae717b")}
}
])
原文地址:https://www.cnblogs.com/500m/p/12215087.html
时间: 2024-10-09 08:19:29