hipthrusts - v1.2.0
    Preparing search index...

    Function LoadByIdRequiredTo

    • LoadResources fragment: Model.findById(id).lean(), throwing HipNotFound when missing -> ctx[key]: Lean. 404-on-missing is the SHORT pattern.

      Type Parameters

      • TRaw
      • TKey extends string
      • TPath extends string

      Parameters

      Returns {
          loadResources: (
              context: CtxRefReq<TPath>,
          ) => Promise<Record<TKey, LeanDocOf<TRaw>>>;
      }

    • LoadResources fragment: Model.findById(id).lean(), throwing HipNotFound when missing -> ctx[key]: Lean. 404-on-missing is the SHORT pattern.

      Type Parameters

      • TRaw
      • TKey extends string
      • TCtx extends object

      Parameters

      • Model: Model<TRaw>
      • key: TKey
      • idSelector: (context: TCtx) => unknown
      • OptionalnotFoundMessage: string

      Returns { loadResources: (context: TCtx) => Promise<Record<TKey, LeanDocOf<TRaw>>> }