src.anlagenbetreiber_services.mongo_database.mongo_database_service.py

MongoDatabaseService

class MongoDatabaseService(*args, **kwargs)

Bases: FastIoTService

MongoDB Database Service

Parameters:
  • args – Positional arguments passed to the superclass or internal use.

  • kwargs – Arbitrary keyword arguments, allowing for extensibility or forwarding to the superclass constructor or other components.

async db_save_many_raw_datapoints(_: str, msg: Thing) Thing

Saves many raw data points to the database.

Parameters:
  • _ (str) – The topic of the message. This is not used in this method.

  • msg – The message that contains the raw data points to be saved to the database.

Returns:

A Thing object that contains the result of the operation. This is either an acknowledgement or an error. Acknowledgements contain the number of raw data points that were saved to the database.

Return type:

Thing

async get_labeled_dataset(_: str, __: Thing) Thing

Queries the database for a labeled dataset and sends it to the requesting service via the broker.

Parameters:
  • _ (str) – Topic of the message

  • __ (Thing) – Message Thing

async setup_labeled_dataset()

Inserts a labeled dataset into the database