为什么猫鼬会为存在的ObjectId返回空结果?
猫鼬运行此查询会得到空结果。
var A1 = function A1() { return React.createElement("div", null); };
var B1 = function B1() { return React.createElement("div", null, React.createElement(A1, null)); };
var A2 = React.createElement("div", null);
var B2 = React.createElement("div", null, A2);
猫鼬反应:
const c = await Category.find({ subCategories: { '$in': [ { _id: mongoose.Types.ObjectId("5ccdc3dd4e88235af8923c62") } ] } });
console.log({ c });
在我的数据库中,此ObjectId的结果...
模型定义:
Mongoose: categories.find({ subCategories: { '$in': [ { _id: ObjectId("5ccdc3dd4e88235af8923c62") } ] } }, { projection: {} })
{ c: '[]' }