How to use Partitions?

I notice when defining a projection, there is a field above the “state” output that lets you specify a “partition”.

I assume this is related to projections having a “partitionBy” concept.
Is there any example of this working I can look at?

Cheers
Nigel

Nigel,

In my example, I have a streams related to products (1 stream per product that has various events)

If you create a projection like this:

fromCategory("StoreProductHistory")
    .foreachStream()
    .when({
            $init: function() {
                return {}
            };
        },
        $any: function(s, e) {
            //TODO: build your state up
        }
    });

And then once it’s caught up, simply paste one of the stream name into that textbox, you will see the partition of that stream (maybe initialy, just do s.count++ to verify it’s really working)

Hope that helps.