Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IUser

A registred user

Hierarchy

Index

Constructors

constructor

  • new IUser(item?: Partial<User>): IUser
  • Creates a generic type T instance object

    Parameters

    • Optional item: Partial<User>

      The item to assign to this instance

    Returns IUser

Properties

Optional __v

__v: number

Version using default version key. See http://mongoosejs.com/docs/guide.html#versionKey If you're using another key, you will have to access it using []: doc[_myVersionKey]

authType

authType: AuthType

The user auth type

base

base: "mongoose"

Base Mongoose instance the model uses.

baseModelName

baseModelName: string | undefined

If this is a discriminator model, baseModelName is the name of the base model.

Optional birthDate

birthDate: Date

The birth date

Optional clone

clone: function

Return a clone with JSON.parse(JSON.stringify(this))

Type declaration

    • (): any
    • Returns any

collection

collection: Collection

Collection the model uses.

db

db: Connection

Connection the model uses.

discriminators

discriminators: any

Registered discriminators for this model.

email

email: string

The email (used also as username)

Optional googleId

googleId: string

The google id, populated if authType Google

Optional id

id: string

The record identifier

Optional image

image: string

The user image

modelName

modelName: string

The name of the model

name

name: string

The full name

Optional password

password: string

The user encrypted password, populated if authType is local

Optional phone

phone: Array<string>

The phone numbers

Optional registrationDate

registrationDate: Date

The registration date

Optional residenceAddress

residenceAddress: Address

The residence address

role

role: Role

The role

schema

schema: Schema

Schema the model uses.

Methods

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getMaxListeners

  • getMaxListeners(): number
  • Returns number

increment

  • increment(): this
  • Signal that we desire an increment of this documents version.

    Returns this

isDeleted

  • isDeleted(isDeleted: boolean): void
  • isDeleted(): boolean
  • Override whether mongoose thinks this doc is deleted or not

    Parameters

    • isDeleted: boolean

    Returns void

  • whether mongoose thinks this doc is deleted.

    Returns boolean

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

model

  • model(name: string): Model<this>
  • Returns another Model instance.

    Parameters

    • name: string

      model name

    Returns Model<this>

on

  • on(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

remove

  • remove(fn?: function): Promise<this>
  • Removes this document from the db.

    Parameters

    • Optional fn: function

      optional callback

        • (err: any, product: this): void
        • Parameters

          • err: any
          • product: this

          Returns void

    Returns Promise<this>

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

save

  • save(options?: SaveOptions, fn?: function): Promise<this>
  • save(fn?: function): Promise<this>
  • Saves this document.

    Parameters

    • Optional options: SaveOptions

      options optional options

    • Optional fn: function

      optional callback

        • (err: any, product: this): void
        • Parameters

          • err: any
          • product: this

          Returns void

    Returns Promise<this>

  • Parameters

    • Optional fn: function
        • (err: any, product: this): void
        • Parameters

          • err: any
          • product: this

          Returns void

    Returns Promise<this>

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

Generated using TypeDoc