BaseModel.findOne() method
Finds the first instance matching the options.
Signature:
static findOne<M>(options?: FindOptions): Promise<M | null>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
options |
(Optional) Find options; |
Returns:
Promise<M | null>
The instance, or null when no row matches.
Remarks
Sequelize's own findOne with one addition: on a model declared as a view, the numeric columns of the result are cast back to numbers.