Abstract class representing a generic data service with CRUD operations and sanitization capabilities.

Hierarchy (View Summary)

Constructors

Properties

collectionName: string
connector: MongoConnector

Methods

  • Deletes an item from the collection identified by the given ID.

    Parameters

    • id: string | number

      The unique identifier of the item to be deleted. Can be a number or a string.

    Returns Promise<boolean>

    A promise that resolves to true if the deletion was successful, or false otherwise.

  • Fetches all data entries from the collection that match the given query. Allows optional skipping of data sanitization.

    Parameters

    • query: string

      The query string used to match entries in the collection.

    • bindings: any[]

      An array of bindings to parameterize the query.

    • OptionalskipSanitization: boolean = false

      Determines whether to skip sanitization of the results.

    Returns Promise<Activities.Semester[]>

    A promise that resolves to an array of matching entries.

  • Finds a single record from the collection based on the provided query and bindings.

    Parameters

    • query: string

      The query string used to locate the record in the collection.

    • bindings: any[]

      An array of bindings to parameterize the query.

    • OptionalskipSanitization: boolean = false

      If true, skips sanitization of the returned data.

    Returns Promise<Activities.Semester>

    A promise that resolves to the found record. If no record is found, the promise resolves to undefined.

  • Retrieves an entity by its unique identifier.

    Parameters

    • id: string | number

      The unique identifier of the entity to retrieve.

    • OptionalskipSanitization: boolean = false

      If true, skips the sanitization of the retrieved data.

    Returns Promise<Activities.Semester>

    A promise that resolves to the retrieved entity.

  • Performs cleanup and de-initialization tasks when the component or service is being destroyed. Typically used to unsubscribe from observables, detach event listeners, or release resources to prevent memory leaks.

    Returns void

    No return value.