H5P NodeJS Library
    Preparing search index...
    initMongo: (
        url?: string,
        db?: string,
        username?: string,
        password?: string,
    ) => Promise<Db>

    Creates a MongoDB client. You must either pass the configuration values through the parameters or set them as environment variables.

    Type declaration

      • (url?: string, db?: string, username?: string, password?: string): Promise<Db>
      • Parameters

        • Optionalurl: string

          (optional) the connection URL for MongoDB (e.g. mongodb://localhost:27105) Can also be set through the environment variable MONGODB_URL.

        • Optionaldb: string

          (optional) the DB Can also be set through the environment variable MONGODB_DB.

        • Optionalusername: string

          (optional) a MongoDB user that can read and write the database Can also be set through the environment variable MONGODB_USER.

        • Optionalpassword: string

          (optional) the password for the MongoDB user Can also be set through the environment variable MONGODB_PASSWORD.

        Returns Promise<Db>

        the MongoDB client