Querying EventStore Web UI

I can’t seem to find any documentation or related posts on this. How can we use the web UI query? Given the baseline:

fromStream(‘my_stream’)
.when({

})

``

Thanks

same as projections in general

fromStream(“foo”).

when({

$init : function() { return 0; }

$any : function(s, e) { return s + 1 }

})

Thanks! I am getting a 405 response from the server, though, on the PUT request:

http://localhost:2113/projection/efe81b74-a631-4e08-b5b8-0deacc4559e0?emit=no&checkpoints=no&enabled=no/query?emit=no

from the UI? Are projections enabled?

Yes, from the UI. At the moment we aren’t utilizing projections so they may not be enabled.

Hey David, I have docs in progress for the Web UI right now to fill this gap, should be complete soon.

Chris

Great, thanks. Will this cover the case of querying when projections are
not enabled?

We should probably return a better error or disallow queries still if
projections are not enabled. As of now queries are run through projections
(need to see what the error comes back as).

Okay, thanks for letting me know

In my test setup projections are active and working.

fromAll()

.when({

$init: function(){

return {

count: 0

}

},

ItemAdded: function(s,e){

if(e.body.Description.indexOf(“Xbox One S”) >= 0){

s.count += 1;

}

}

})

I just copied the ‘query’ from a working projection, but when ran it give a nice red bar stating something went wrong. But what ?