/** * @param string $name The name of this aggregation * @param string $path Optional path to the nested object for this aggregation. Defaults to the root of the main document. */ public function __construct($name, $path = null) { parent::__construct($name); if ($path !== null) { $this->setPath($path); } }
/** * @param string $name the name if this aggregation * @param string|null $initScript Executed prior to any collection of documents * @param string|null $mapScript Executed once per document collected * @param string|null $combineScript Executed once on each shard after document collection is complete * @param string|null $reduceScript Executed once on the coordinating node after all shards have returned their results */ public function __construct($name, $initScript = null, $mapScript = null, $combineScript = null, $reduceScript = null) { parent::__construct($name); if ($initScript) { $this->setInitScript($initScript); } if ($mapScript) { $this->setMapScript($mapScript); } if ($combineScript) { $this->setCombineScript($combineScript); } if ($reduceScript) { $this->setReduceScript($reduceScript); } }
/** * @param string $name the name of this aggregation * @param string $field the field on which to perform this aggregation */ public function __construct($name, $field) { parent::__construct($name); $this->setField($field); }
/** * @param string $name the name of this aggregation * @param string $path the nested path for this aggregation */ public function __construct($name, $path) { parent::__construct($name); $this->setPath($path); }
public function __construct($propertyName) { parent::__construct('SUM', $propertyName); }