接著利用mongoDB 可直接寫函數userSchema.methods.canPlayRoleOf = function(role) 來讓外部呼叫,並response 此User 的角色為何,Schema 如下所示:
確定! 回上一頁