Hi,
I am trying to incorporate the eventstore in a private project to see if this can be used in our business applications. So far it seems like a cool piece of technology but unfortunatelly I am stuck in a tutorial that was done 5 years ago
What I have done is adding some events to a stream and splitting it up into categories. I have a “User” Stream that now is separated in streams categories by ID:
fromStream(‘UsersTest’)
.when(
{
$any : function(s,ev) { linkTo(‘TestUser-’ + ev.data.Id, ev);
}
});
I then made a projection “Users” that should allow me to querry the individual user like this:
fromCategory(‘TestUser’)
.foreachStream()
.when({
“$init”: function(state, ev) {
return {}
},
“UserCreatedEvent”: function(state, ev) {
return {
Id: ev.data.Id,
Name: ev.data.Name,
LastName: ev.data.LastName
}
},
“UserNameChangedEvent”: function(state, ev) {
return {
Id: ev.data.Id,
Name: ev.data.Name,
LastName: ev.data.LastName
}
}
})
What I expected that I could call the Projection above with this call: http://127.0.0.1:2113/projection/Users/state?partition=TestUser-4. But all I get is a 200 and no User object. I tried various permutaions of this projection URL like http://127.0.0.1:2113/projection/Users/state?partition=4 or http://127.0.0.1:2113/projection/Users but all I got is a 200 without a body. As the docs say, it should work like the first one, but it does not. Am I missing something here? Also am i right, that I would call the projection with the c# api like this: projectionsManager.GetPartitionResultAsync(“Users”, “5”)
This also just gives me an empty body, but I woul expect this as the projection does not return anything right now.
Also, is the “state” field on the web UI next to the projection a way to make this call with the UI? This also just return nothing, or is this not ment to set the state for a test?
Simon