Get Time Series Names



getTimeSeriesFor usage

Flow:

  • Open a session.
  • Load an entity to the session either using session.load or by querying for the document via session.query.
    In both cases, the resulting entity will be tracked by the session.
  • Call advanced.getTimeSeriesFor, pass the tracked entity.

Note:

  • If the entity is Not tracked by the session, an ArgumentException exception is thrown.

Example

// Open a session
$session = $store->openSession();
try {
    // Load a document entity to the session
    $user = $session->load(User::class, "users/john");

    // Call GetTimeSeriesFor, pass the entity
    $tsNames = $session->advanced()->getTimeSeriesFor($user);

    // Results will include the names of all time series associated with document 'users/john'
} finally {
    $session->close();
}

Syntax

def get_time_series_for(self, entity: object) -> List[str]:
    ...
Parameter Type Description
entity object The entity whose time series names you want to get
Return value
List[str] A list of names of all the time series associated with the entity, sorted alphabetically by the name