Creates a new record in the collection associated with this instance.
The data to be stored in the collection.
Optional
skipSanitization: boolean = falseIndicates whether to skip sanitization of the data before returning it.
A promise that resolves to the created and optionally sanitized record.
Deletes an item from the collection identified by the given ID.
The unique identifier of the item to be deleted. Can be a number or a string.
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.
The query string used to match entries in the collection.
An array of bindings to parameterize the query.
Optional
skipSanitization: boolean = falseDetermines whether to skip sanitization of the results.
A promise that resolves to an array of matching entries.
Finds a single record from the collection based on the provided query and bindings.
The query string used to locate the record in the collection.
An array of bindings to parameterize the query.
Optional
skipSanitization: boolean = falseIf true, skips sanitization of the returned data.
A promise that resolves to the found record. If no record is found, the promise resolves to undefined.
Retrieves all items from the collection and optionally applies sanitization.
Optional
skipSanitization: boolean = falseIf true, sanitization will be skipped; otherwise, all items will be sanitized.
A promise that resolves to an array of items, optionally sanitized.
Retrieves an entity by its unique identifier.
The unique identifier of the entity to retrieve.
Optional
skipSanitization: boolean = falseIf true, skips the sanitization of the retrieved data.
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.
No return value.
Updates a record in the specified collection and optionally skips data sanitization.
The data to be updated in the collection.
Optional
skipSanitization: boolean = falseWhether to skip sanitization of the returned data.
A promise that resolves to the updated record, either sanitized or unsanitized based on the value of skipSanitization.
Updates multiple entries in the database collection and optionally sanitizes the updated data.
The array of data objects to be updated in the collection.
Optional
skipSanitization: boolean = falseA flag to determine whether sanitization of updated objects should be skipped. Defaults to false.
Abstract class representing a generic data service with CRUD operations and sanitization capabilities.