public function assemblePipeline() {
		$aggregate = [];
		
		// Conditions
		if (! empty($this->_conditions)) {
			$aggregate[] = [self::MONGO_PIPE_MATCH => $this->_conditions];
		}
		
		// Group
		if (! empty($this->_groupDefinition)) {
			$group = $this->_groupDefinition;
			
			$group[MongoCollection::DEFAULT_PRIMARY] = ($this->_groupBy === null)
				? null
				: '$' . $this->_groupBy;
			
			$aggregate[] = [self::MONGO_PIPE_GROUP => $group];
		}
		
		// Sort
		if (! empty($this->_sort)) {
			$aggregate[] = [self::MONGO_PIPE_SORT => $this->_sort];
		}
		
		// Offset
		if ($this->_offset !== null) {
			$aggregate[] = [self::MONGO_PIPE_OFFSET => $this->_offset];
		}
		
		// Limit
		if ($this->_limit !== null) {
			$aggregate[] = [self::MONGO_PIPE_LIMIT => $this->_limit];
		}
		
		return $aggregate;
	}
public function assemblePipeline() {
		$aggregate = [];
		
		// Conditions
		if (! empty($this->_conditions)) {
			$aggregate[] = [self::MONGO_PIPE_MATCH => $this->_conditions];
		}
		
		// Group
		if (! empty($this->_groupDefinition)) {
			$group = $this->_groupDefinition;
			
			$group[MongoCollection::DEFAULT_PRIMARY] = ($this->_groupBy === null)
				? null
				: '$' . $this->_groupBy;
			
			$aggregate[] = [self::MONGO_PIPE_GROUP => $group];
		}
		
		// Sort
		if (! empty($this->_sort)) {
			$aggregate[] = [self::MONGO_PIPE_SORT => $this->_sort];
		}
		
		// Offset
		if ($this->_offset !== null) {
			$aggregate[] = [self::MONGO_PIPE_OFFSET => $this->_offset];
		}
		
		// Limit
		if ($this->_limit !== null) {
			$aggregate[] = [self::MONGO_PIPE_LIMIT => $this->_limit];
		}
		
		return $aggregate;
	}
public function assemblePipeline ( ) { $ aggregate = [ ] ; // Conditions if ( ! empty ( $ this -> _conditions ) ) { $ aggregate [ ] = [ self :: MONGO_PIPE_MATCH => $ this -> _conditions ] ; } // Group if ( ! empty ( $ this -> _groupDefinition ) ) { $ group = $ this -> _groupDefinition ; $ group [ MongoCollection :: DEFAULT_PRIMARY ] = ( $ this -> _groupBy === null ) ? null : '$' . $ this -> _groupBy ; $ aggregate [ ] = [ self :: MONGO_PIPE_GROUP => $ group ] ; } // Sort if ( ! empty ( $ this -> _sort ) ) { $ aggregate [ ] = [ self :: MONGO_PIPE_SORT => $ this -> _sort ] ; } // Offset if ( $ this -> _offset !== null ) { $ aggregate [ ] = [ self :: MONGO_PIPE_OFFSET => $ this -> _offset ] ; } // Limit if ( $ this -> _limit !== null ) { $ aggregate [ ] = [ self :: MONGO_PIPE_LIMIT => $ this -> _limit ] ; } return $ aggregate ; }
Assemble the aggregate pipeline

@return array
Assemble the aggregate pipeline