bitcount

Counts the number of set bits (population counting) in a string.

[Redis documentation]


Query Syntax

HTTP

Copied to clipboard!
URL: http://kuzzle:7512/ms/_bitcount/<_id>[?start=<integer>&end=<integer>]
Method: GET

Other protocols

Copied to clipboard!
{
  "controller": "ms",
  "action": "bitcount",
  "_id": "<key>"
  "start": <integer>,
  "end": <integer>
}

Arguments

  • _id: key to evaluate

Optional:

  • start: count starts at the provided offset
  • end: count ends at the provided offset

Response

Returns the number of set bits.

Copied to clipboard!
{
  "requestId": "<unique request identifier>",
  "status": 200,
  "error": null,
  "controller": "ms",
  "action": "bitcount",
  "collection": null,
  "index": null,
  "result": 42
}