

























这是一个创建于 1342 天前的主题,其中的信息可能已经有所发展或是发生改变。
有两个表,一个用户表,一个订单表,现在想要查询所有 appId 为 1 的用户的订单应该怎么查询呢
const orderSchema = new mongoose.Schema({
user: {
type: mongoose.SchemaTypes.ObjectId,
ref: "User",
required: true
},
orderNum: {
type: String,
required: true
},
})
const UserSchema = new mongoose.Schema({
nickname: String,
avatarUrl: String,
phone: String,
appId: {
type: String,
}
});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。