Mongodb

需要对 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