Function: Id()

function Id<This, Value>(target: undefined, context: ClassFieldDecoratorContext<This, Value>): (this: This, initialValue: Value) => Value;

Defined in: src/data-management/decorators/id.ts:29

Type Parameters

Type Parameter
This extends object
Value extends string | number

Parameters

Parameter Type
target undefined
context ClassFieldDecoratorContext<This, Value>

Returns

(this: This, initialValue: Value): Value;

Parameters

Parameter Type
this This
initialValue Value

Returns

Value

Id

Example

class User {

Id

id: string; // Campo ID

Id

userId: string; // También funciona con otros nombres

Id

_id: string; // MongoDB style }