我真的需要一些帮助。让我解释一下。
所以,我有以下模式:
export const projectSchema: Schema = new Schema({
title: String,
description: String,
code: String,
price: Number,
currency: String,
taskCount: {
type: Number,
default: 0
},
client: {
type: Schema.Types.ObjectId,
ref: "Client"
},
team: [{
type: Schema.Types.ObjectId,
ref: "User"
}],
notes: [{
type: Schema.Types.ObjectId,
ref: "ProjectNote"
}]
}
和:
export const userSchema: Schema = new Schema({
username: String,
password: String,
role: String,
email: String,
fullname: String,
avatar: String,
location: String,
}
所以基本上,我有项目,每个项目都有一个用户团队。 我想要的是来自我所参与的团队的所有用户(与众不同)。有什么帮助吗?