Persisting projections when MemDb = true

I’ve setup a docker container for EventStore which is restarted before I run unit tests on my dev machine.
What I really like about this system is that I can setup the EventStore configuration to use MemDb and then restart the docker container at the beginning of the test run, starting all the tests with a fresh clean EventStore each time.

The problem is that I’m losing any projects that I manually setup in the EventStore.

Is there a way to add projection definitions to the configuration file or via some kind of cli or api, so that I can include projections in my test runs too?

I’ve attached my current docker container definition in case you need to see it.

Thank you. (2.15 KB)

typo: projects = projections

I’ve looked at the documentation here and seen this method for creating a continuous projection.
Unfortunately, it doesn’t seem to contain parameters for the actual javascript body of the projection.


To make that clear, I’m trying to persist projection definitions, NOT the projection state or results or emitted streams. Just the definition, so it’s ready to go up and running when the container restarts.

the body of the post is the actual projection. This is exactly how the UI works it posts the projection. There is also a wrapper in the client api of the http api

That’s fantastic. Thank you so much.