Event Count - Flipkart/foxtrot GitHub Wiki

The count operation gives count of events for a particular table under specified conditions.

Parameters

  • opcode - count (not_null) - Operation code for this analytics
  • table - table_name (not-null) - Table on which analytics will be run
  • filters - Array of filters (Optional - defaults to no filters)
  • field - <field_name> (Optional - If present, count will be calculated for those docs where this particular field is not null)
  • distinct - true/false (Optional - Works if {field} parameter is present. If set to true, then result will be count of distinct values of that particular field)

Sample Request

{
    "opcode": "count",
    "table": "test",
    "filters": [
        {
            "field": "battery",
            "operator": "greater_than",
            "value": 48
        }
    ],
    "field": "os_version",
    "distinct": false
}

Sample Response

{
    "opcode": "count",
    "count": 12
}
⚠️ **GitHub.com Fallback** ⚠️