public function group($group, $context) {
		if (!$group) {
			return;
		}
		if (is_string($group) && strpos($group, 'function') === 0) {
			return ['$keyf' => new MongoCode($group)];
		}
		$group = (array) $group;

		foreach ($group as $i => $field) {
			if (is_int($i)) {
				$group[$field] = true;
				unset($group[$i]);
			}
		}
		return ['key' => $group];
	}
public function group($group, $context) {
		if (!$group) {
			return;
		}
		if (is_string($group) && strpos($group, 'function') === 0) {
			return ['$keyf' => new MongoCode($group)];
		}
		$group = (array) $group;

		foreach ($group as $i => $field) {
			if (is_int($i)) {
				$group[$field] = true;
				unset($group[$i]);
			}
		}
		return ['key' => $group];
	}
public function group ( $ group , $ context ) { if ( ! $ group ) { return ; } if ( is_string ( $ group ) && strpos ( $ group , 'function' ) === 0 ) { return [ '$keyf' => new MongoCode ( $ group ) ] ; } $ group = ( array ) $ group ; foreach ( $ group as $ i => $ field ) { if ( is_int ( $ i ) ) { $ group [ $ field ] = true ; unset ( $ group [ $ i ] ) ; } } return [ 'key' => $ group ] ; }
Formats `group` clauses for MongoDB.

@param string|array $group The group clause.
@param object $context
@return array Formatted `group` clause.
Formats group clauses for MongoDB .