public function addAggregate($name, $options) { $this->aggregations[$name] = $options; return $this; }