Event Store logo

Menu

Documentation

Show Table of Contents

Projections Management

The Event Store Client API includes some helper methods that use the HTTP API to allow for the management of projections in the system. This document will describe the methods found in the ProjectionsManager class (in addition to the XML docs already on it). Note all methods in this class are async.

Methods

Enable a Projection

Enables an existing projection by its name. You must have access to a projection in order to enable it.

public Task EnableAsync(string name, UserCredentials userCredentials = null)

Disable a Projection

Disables an existing projection by its name. You must have access to a projection in order to disable it.

public Task DisableAsync(string name, UserCredentials userCredentials = null)

Abort a Projection

Aborts an existing projection by its name. You must have access to a projection in order to abort it.

public Task AbortAsync(string name, UserCredentials userCredentials = null)

Create a One-Time Projection

Creates a projection that will run until the end of the log and then stop. The query parameter contains the javascript you want to be created as a one time projection.

public Task CreateOneTimeAsync(string query, UserCredentials userCredentials = null)

Create a Continuous Projection

Creates a projection that will run until the end of the log and then continue running. The query parameter contains the javascript you want to be created as a one time projection. Continuous projections have explicit names and can be enabled/disabled via this name

public Task CreateContinuousAsync(string name, string query, UserCredentials userCredentials = null)

List all Projections

Returns a list of all the projections in the system.

public Task<List<ProjectionDetails>> ListAllAsync(UserCredentials userCredentials = null)

List One-Time Projections

Returns a list of all One-Time Projections in the system

public Task<List<ProjectionDetails>> ListOneTimeAsync(UserCredentials userCredentials = null)

Get Statistics on Projection

Returns the statistics associated with a named projection

public Task<string> GetStatisticsAsync(string name, UserCredentials userCredentials = null)

Delete Projection

Deletes a named projection. You must have access to a projection in order to delete it.

public Task DeleteAsync(string name, UserCredentials userCredentials = null)

Get State

Retrieves the state of the projection

public Task<string> GetState(string name, UserCredentials userCredentials = null)

Get Partition State

Retrieves the state of the projection via the given partition

public Task<string> GetPartitionStateAsync(string name, string partition, UserCredentials userCredentials = null)

Get Result

Retrieves the result of the projection

public Task<string> GetResult(string name, UserCredentials userCredentials = null)

Get Partition Result

Retrieves the result of the projection via the given partition

public Task<string> GetPartitionResultAsync(string name, string partition, UserCredentials userCredentials = null)

Event Store docs are hosted on GitHub. The repository is public and it’s open to issues and pull requests. Contributions, corrections and feedback are all welcome.