Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RolesRepository

The Role repository

Hierarchy

Index

Constructors

constructor

Properties

collectionName

collectionName: string

The collection name, used also as controller route name

Protected model

model: Model<IRole>

The mongoose model for this repository

Protected roleModel

roleModel: Model<IRole>

The injected RoleSchema model

Methods

create

  • create(item: Role): Promise<IRole>

delete

  • delete(id: string): Promise<boolean>

find

findOne

get

  • get(id: string): Promise<IRole>

getOrCreateOne

  • getOrCreateOne(type: number | RoleType, name: string): Promise<IRole>
  • Gets or create a role. Reject with an error if the operation fails

    Parameters

    • type: number | RoleType

      The role type

    • name: string

      The role name

    Returns Promise<IRole>

partialUpdate

  • partialUpdate(id: string, item: Partial<Role>): Promise<IRole>

update

  • update(item: Role): Promise<IRole>

Generated using TypeDoc