【发布时间】:2021-09-04 05:38:54
【问题描述】:
我有 2 个架构
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const {ObjectId} = mongoose.Schema;
const matchList = new Schema({
user:[{
type: ObjectId,
ref:'User'
}]
});
const user = new Schema({
name:{
type:String
}
});
matchlist 包含一个用户字段,它是来自用户模式的用户 ID 数组。 如何从用户架构中获取 id 不在匹配列表集合中的所有用户?
【问题讨论】:
标签: javascript node.js mongodb express mongoose