Difference between $by_category and $stream_by_category

As far as I can tell (the wording in the docs is almost word for word identical) these two system projections are supposed to do the same thing, I guess to allow us to run both ‘first’ and ‘last’ style at the same time. I’ve enabled both on a dev instance though and am not getting that behaviour. /streams/$ce-foo at etc work correctly (set to first, -) but $category-foo-bar-baz (set to last, -) only contains one event with some metadata

{
  "$v": "3:3:3:3",
  "$c": 16619657,
  "$p": 16619657,
  "$causedBy": "0ef07b1c-5812-4b9c-9283-91d0ab2002cc"
}

``

but no data.

What am I missing here?

Hi, I’m also wondering the same thing here, have you found the answer Elija?

Thanks,

Ross

$by_category generates links to all events, indexed by the first part of a stream id (up to the first dash).

Output stream is $ce-{categoryId}

The use case is subscribing to all events within a category.

$stream_by_category generates a stream reference (data of 0@streamId I think) for each stream within a category (again everything before the first dash.)

Output stream is $category-{categoryId}

The use case is subscribing to all stream instances of a category.

Thanks Laurence, the use case is exactly what I needed to see the difference, much appreciated. Ross