code: func (e *executor) executeCount(ctx context.Context, index string, c *pql.Call, shards []uint64, opt *execOptions) (uint64, error) {
  	span, ctx := tracing.StartSpanFromContext(ctx, "Executor.executeCount")
  	defer span.Finish()
  
  	if len(c.Children) == 0 {
  		return 0, errors.New("Count() requires an input bitmap")
  	} else if len(c.Children) > 1 {
  		return 0, errors.New("Count() only accepts a single bitmap input")
  	}
  
  	// Execute calls in bulk on each remote node and merge.
  	mapFn := func(shard uint64) (interface{}, error) {
  		row, err := e.executeBitmapCallShard(ctx, index, c.Children[0], shard)
  		if err != nil {
  			return 0, err
  		}
  		return row.Count(), nil
  	}
  
  	// Merge returned results at coordinating node.
  	reduceFn := func(prev, v interface{}) interface{} {
  		other, _ := prev.(uint64)
  		return other + v.(uint64)
  	}
  
  	result, err := e.mapReduce(ctx, index, shards, c, opt, mapFn, reduceFn)
  	if err != nil {
  		return 0, err
  	}
  	n, _ := result.(uint64)
  
  	return n, nil
  }
docs: // executeCount executes a count() call.