Options
All
  • Public
  • Public/Protected
  • All
Menu

@albert-team/mongol

Index

Type aliases

DatabaseHookEvent

DatabaseHookEvent: "before" | "during" | "after"

Database hook event.

Variables

Const DELETE_OPERATIONS

DELETE_OPERATIONS: Set<CrudOperation> = new Set([CrudOperation.DeleteMany,CrudOperation.DeleteOne,CrudOperation.FindOneAndDelete])

Const INSERT_OPERATIONS

INSERT_OPERATIONS: Set<CrudOperation> = new Set([CrudOperation.InsertMany,CrudOperation.InsertOne])

Const OMITTED_JSON_SCHEMA_KEYWORDS

OMITTED_JSON_SCHEMA_KEYWORDS: Set<string> = new Set(['$ref','$schema','default','definitions','format','id'])

JSON Schema keywords that MongoDB does not support.

Const REPLACE_OPERATIONS

REPLACE_OPERATIONS: Set<CrudOperation> = new Set([CrudOperation.FindOneAndReplace,CrudOperation.ReplaceOne])

Const UPDATE_OPERATIONS

UPDATE_OPERATIONS: Set<CrudOperation> = new Set([CrudOperation.FindOneAndUpdate,CrudOperation.UpdateMany,CrudOperation.UpdateOne])

Const autoTimestamp

autoTimestamp: createTimestampHook = createTimestampHook
deprecated

Since v0.5.0. Use createTimestampHook instead.

Functions

Const createTimestampHook

Const getCrudOp

Const isParsedCrudOperationArgs

Const parseCrudOperationArgs

Const removeProperties

  • removeProperties(schema: object, propNames: Set<string>, ignoreThisLevel?: boolean): object
  • Parameters

    • schema: object
    • propNames: Set<string>
    • Default value ignoreThisLevel: boolean = false

    Returns object

Const unparseCrudOperationArgs

Const withTimestamp

  • withTimestamp<T>(doc: T, propName: string): T
  • Type parameters

    • T

    Parameters

    • doc: T
    • propName: string

    Returns T