我有一个模式: name: String, tagId: mongoose.Schema.Types.ObjectIdeventSchema);var arrayOfTagsIds = [23, 55, 71];
// in this example I'm not using realmongo id's, which are strin
使用Mongoose,我想要找出一个特定的用户(基于他们的id)是否具有admin角色。如何执行该查询?在SQL中,查找结果的一种方法是编写以下查询: SELECT *INNER JOIN Roles ON Users.id = Roles.userID
WHERE (Users.id= <some user id> AND Roles.name='admin') 但是我不明白如何使用Mongoose来完成相同的<