metronom / Modules / ModelInstance / default
Class: default
ModelInstance.default
ModelInstance Class
Indexable
▪ [index: string]: any
Table of contents
Properties
Constructors
Methods
Properties
_Model
• _Model: ModelFields
Defined in
Constructors
constructor
• new default(data, model, dataInfo)
Represents an object produced from Metronom ORM Model
Parameters
| Name | Type | Description |
|---|---|---|
data | Object | Lead data |
model | default | Parent model to generate object |
dataInfo | DataInfo | The place where redis information about the record is kept. |
Methods
save
▸ save(): Promise<void>
Saves the current state of the object to Redis.
Returns
Promise<void>
getPureData
▸ getPureData(): Object
Clears all metronome-related data within the object and restores it to its raw state.
Returns
Object
raw data
toJSON
▸ toJSON(): string
Converts the object to JSON
Returns
string
stringified object
destroy
▸ destroy(): Promise<boolean>
Destroy the object from Redis.
Returns
Promise<boolean>
Returns true or false that it has been deleted.
metronom