Skip to content
approval@dev

API

Schema

@rivyn/db


@rivyn/db / Schema

Class: Schema

Constructors

Constructor

new Schema(definition, options?): Schema

Parameters

definition

SchemaDefinition

options?

SchemaOptions = {}

Returns

Schema

Properties

timestamps

readonly timestamps: boolean

Methods

indexPaths()

indexPaths(): object[]

Returns

object[]


prepareUpdate()

prepareUpdate(update): Record<string, unknown>

Parameters

update

Record<string, unknown>

Returns

Record<string, unknown>


resolvePath()

resolvePath(path): FieldDef | null

Parameters

path

string

Returns

FieldDef | null


toServerSpec()

toServerSpec(): ServerSchemaSpec

Returns

ServerSchemaSpec


uniquePaths()

uniquePaths(): string[]

Returns

string[]


validateDoc()

validateDoc(input): Record<string, unknown>

Parameters

input

unknown

Returns

Record<string, unknown>