【发布时间】:2021-12-09 14:44:20
【问题描述】:
我按用户(userID)创建了一个团队,现在我想搜索该用户是否存在于团队中。
exports.start = async (message) => {
const check = await group.find({userID1:message.author.id} ||{userID2:message.author.id} || {userID3:message.author.id})
console.log(check);
}
我的数据库是这样的
{
"_id" : ObjectId("6173107fcf643f15e1fced83"),
"userID1" : "769819933390667796",
"userName1" : "Davion",
"userID2" : "247276609894219777",
"userName2" : "Davion",
"userID3" : "898413310872006716",
"userName3" : "Davion",
"team" : "3",
"__v" : 0
}
【问题讨论】:
标签: javascript node.js mongodb mongoose discord.js