Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "index"

Index

Variables

Const ERR_NO_QUERY

ERR_NO_QUERY: "no query parameters detected" = "no query parameters detected"

Const ERR_PAYLOAD_INVALID

ERR_PAYLOAD_INVALID: "payload invalid" = "payload invalid"

Const KEY_GET_PARAMS

KEY_GET_PARAMS: "resource.mongodb.search.params" = "resource.mongodb.search.params"

Const KEY_REMOVE_PARAMS

KEY_REMOVE_PARAMS: "resource.mongodb.remove.params" = "resource.mongodb.remove.params"

Const KEY_SEARCH_PARAMS

KEY_SEARCH_PARAMS: "resource.mongodb.search.params" = "resource.mongodb.search.params"

Const KEY_UPDATE_PARAMS

KEY_UPDATE_PARAMS: "resource.mongodb.update.params" = "resource.mongodb.update.params"

Functions

Const runCreate

  • runCreate<T>(model: Model<T>, data: T): Action<Id>
  • runCreate creates a new document in the provided Model's collection.

    It is important the data supplied to this function is properly validated or bad things can happen.

    Type parameters

    • T: Object

    Parameters

    • model: Model<T>
    • data: T

    Returns Action<Id>

Const runGet

  • runGet<T>(model: Model<T>, id: Id, params: GetParams): Action<Maybe<T>>
  • runGet retrieves a single document given its id.

    Additional query parameters may be included using the GetParams parameter.

    It is important the data supplied to this function is properly validated or bad things can happen.

    Type parameters

    • T: Object

    Parameters

    Returns Action<Maybe<T>>

Const runRemove

  • runRemove<T>(model: Model<T>, id: Id, params: RemoveParams): Action<boolean>
  • runRemove a single document by its key.

    Additional query parameters may be included via the RemoveParams parameter.

    It is important the data supplied to this function is properly validated or bad things can happen.

    Type parameters

    • T: Object

    Parameters

    Returns Action<boolean>

Const runSearch

  • runSearch for documents in the database that match the specified SearchParams.

    It is important the data supplied to this function is properly validated or bad things can happen.

    Type parameters

    • T: Object

    Parameters

    Returns Action<SearchResult<T>>

Const runUpdate

  • runUpdate<T>(model: Model<T>, id: Id, changes: Object, params: UpdateParams): Action<boolean>
  • runUpdate updates a single document by id.

    The UpdateParams may be specified to add further details to the operation.

    It is important the data supplied to this function is properly validated or bad things can happen.

    Type parameters

    • T: Object

    Parameters

    • model: Model<T>
    • id: Id
    • changes: Object
    • params: UpdateParams

    Returns Action<boolean>

Generated using TypeDoc