Skip to content
On this page

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

ModelInstance.ts:17

Constructors

constructor

new default(data, model, dataInfo)

Represents an object produced from Metronom ORM Model

Parameters

NameTypeDescription
dataObjectLead data
modeldefaultParent model to generate object
dataInfoDataInfoThe 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.

Released under the MIT License.