Skip to content

Instantly share code, notes, and snippets.

@MikeBild
Created June 27, 2014 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikeBild/b980811301e1fe326f7d to your computer and use it in GitHub Desktop.
Save MikeBild/b980811301e1fe326f7d to your computer and use it in GitHub Desktop.
Simple ES Query
eventsource
.fromStreams(['os'], 'statistics')
.run({
$init: function(state){
state.count = 0;
return state;
},
$completed: function(state){
return state;
},
os: function(state, item){
state.count += 1;
return state;
}}, function(err, data){
done(null,data);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment