Jersey City 911 Call Analytics

node v10.24.1
version: 1.0.0
endpointsharetweet
const stae = require("stae") const api = stae.createClient({ key: '' }) const total = { name: 'Total #', type: 'number', alias: 'total', value: { function: 'count' } } const weekly = { name: 'Last Week', type: 'number', alias: 'weekly', value: { function: 'count' }, filters: { data: { receivedAt: { $gte: { function: 'lastWeek' } } } } } const typicalResponse = { name: 'Typical Response', type: 'number', measurement: { type: 'duration', value: 'millisecond' }, alias: 'response', value: { function: 'median', arguments: [ { function: 'interval', arguments: [ { field: 'data.receivedAt' }, { field: 'data.arrivedAt' } ] } ] }, filters: { data: { receivedAt: { $ne: null, $lt: { field: 'data.arrivedAt' } }, arrivedAt: { $ne: null } } } } const { results } = await api.place.dataType.analytics({ placeId: 'jers-nj', dataTypeId: '911-call', options: { filters: { data: { officers: { $ne: null } } }, aggregations: [ { alias: 'officer', value: { function: 'expand', arguments: [ { field: 'data.officers' } ] } }, typicalResponse, weekly, total ], orderings: [ { value: { field: 'total' }, direction: 'desc' } ], groupings: [ { field: 'officer' } ] } })
Loading…

no comments

    sign in to comment