@storehouse/mongoose - v4.0.0
    Preparing search index...

    Class MongooseManager

    Implements

    • IManager
    Index

    Constructors

    Properties

    name: string
    type: "@storehouse/mongoose" = '@storehouse/mongoose'

    Methods

    • Close the connection gracefully

      Returns Promise<void>

      Promise that resolves when connection is closed, or void for synchronous close

    • Returns Promise<Connection>

    • Get the underlying connection/client instance

      Returns Connection

      The connection object (database client, pool, etc.)

    • Get a model by name (optional)

      Type Parameters

      • T = {}
      • TModel extends Model<
            T,
            {},
            {},
            {},
            IfAny<
                T,
                any,
                Document<unknown, {}, T, {}, DefaultSchemaOptions> & Require_id<T> & {
                    __v: number;
                } & AddDefaultId<T, {}, DefaultSchemaOptions>,
            >,
            any,
            T,
        > = Model<
            T,
            {},
            {},
            {},
            IfAny<
                T,
                any,
                Document<unknown, {}, T, {}, DefaultSchemaOptions> & Require_id<T> & {
                    __v: number;
                } & AddDefaultId<T, {}, DefaultSchemaOptions>,
            >,
            any,
            T,
        >
      • TQueryHelpers = unknown

      Parameters

      • name: string

        The name of the model to retrieve

      Returns TModel & WithAggregationMethod

      The model instance or undefined if not found

    • Check if the connection is currently connected/active (optional)

      Returns Promise<boolean>

      true if connected, false otherwise

    • Parameters

      • Optionalvalue: string | ObjectId | Uint8Array<ArrayBufferLike> | ObjectIdLike

      Returns ObjectId | undefined