Skip to content

Instantly share code, notes, and snippets.

@ascsystems
Created August 30, 2013 03:28
Show Gist options
  • Select an option

  • Save ascsystems/6386062 to your computer and use it in GitHub Desktop.

Select an option

Save ascsystems/6386062 to your computer and use it in GitHub Desktop.
$this->source = $this->getServiceLocator()->get('notifications');
$group['keys'] = array('type' => 1);
$group['initial'] = array('notifications' => array());
$group['reduce'] = $reduce = "function (obj, prev) { prev.items.push(obj.name); }";
$query = $this->source->group($group['keys'], $group['initial'], $group['reduce'])->query()->sort('title');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment