Enable $by_category


How do I programmatically enable the predefined project $by_category?

Can I enable it via the command line? Using --run-Projections=ALL doesn’t seem to have an effect.

Thank you.

once its enabled it will stay enabled through restarts

You can programmatically enable it using either PAdmin (which makes HTTP calls) or by making an empty POST request to `/projection/%24by_category/command/enable` - you’ll get back a 200 if it is enabled successfully.



That’s great. Thank you.

You should only need to do this once however. Are you intending to start many many systems for the projections (maybe for building up a test node from scratch etc)? Once its started it will survive reboots etc.

It’s for test purposes yes. I haven’t figured out the whole integration test story yet. I intend to wipe the database file in between tests (or at testfixture shutdown etc…). And in that case I assume the enabling of $by_category wouldn’t survive a reboot…

You likely want a new DB every time rather than wiling. --mem-db is perfect for this scenario but will need the projections enabling each time

Try --mem-db :slight_smile: