From my POV it seems your response is unrelated to the question because:
above example is how docs and example apps have you implement index to better query chosen fields
docs define composites as a category that contains models. Composites dont seem related to my question unless there’s something about StreamIDs that im not connecting in my mind - which is very possible
But that’s complex and not sure I need to understand that. I understand you can index by a string or DateTime - but im not certain if it will work for a StreamID. Ive searched and every example app only has createIndex directive using strings - so guess that’s it?
When you use @documentReference to define a relation to another Stream, that field automatically gets indexed. There’s no need to add a separate @createIndex directive.
CC @jpham@Justina - this could probably use some clarification in the docs.
CC @paul@StephH@cole - maybe we can add a clearer error message here if someone tries to add an index on a relation. Could be a good starter ticket for one of our new hires.