The object that extends the model.
Meta contains the 'metadata' fields of an object. This includes the identifier, creation time and last updated time.
Datastore
object that handles this model.
Deletes the object via Datastore
. You have to make sure that this.store
is not null.
Saves the object via Datastore
. You have to make sure that this.store
is not null.
If the object already has this.meta.id
set, it will update the object in
the database under this.meta.id
. Otherwise, if the identifier not set,
it will create a new object in the database and set the this.meta
field.
Sets the creation time of an object.
UNIX timestamp of the time.
Sets the fields that are required by Datastore
.
Identifier of an object and the Datastore
object.
Sets the Datastore
object of this model.
The Datastore
object.
Sets the last updated time of an object.
UNIX timestamp of the time.
Generated using TypeDoc
Model is essentialy a set of fields and functions that is used in
Datastore
.It contains
.meta
field, that contains the identifier of an object, etc.Usage
export class Human extends Model<Human> { name: string; constructor(name: string) { super() this.name = name } }