Finds Events on the specified Stream which match the specified options.
Octave.Event.find(streamId, options)
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
streamId | String | Yes | The unique ID of the Stream. |
options | Object | Yes | An optional object literal of query options. |
options.filter | String | No | A filter string. |
options.start | Integer | No | The start index of the search (default value is 0). |
options.limit | Integer | No | The maximum response size (default value is 20). |
options.sort | String | No | String representation of the member key to sort the results over (default value is the creation date). |
options.order | String | No | Specifies the sort order. Can be set to asc and desc (default value is desc ). |
Returns
An array of JSON representations of the matching Events.
Request
//find the most recent 2 events where x > 1:
var events = Octave.Event.find("s5b7c2258c4eaa25486be2ed1", {"filter": "x > 1", "sort":"creationDate", "limit": 2});
Response
// events now contains an array with matching values
[
{
elems:
{
x:1
},
creationDate: 1534865286261,
...
},
{
elems:
{x:1},
....
}
]