Skip to content

Feature - support count unique #23

@rantav

Description

@rantav

It would be nice and useful to support a count of uniques across a specified field in the collection documents (or to be able to provide a uniqueId function that accepts a document and returns its unique ID for the sake of this count).

Is this BTW perhaps already supported?...

Example:

Counts.publish(this, 'unique-name-of-counter', 
    Posts.find(), 
    {uniqueField: 'referrerId'});

// or: 

Counts.publish(this, 'unique-name-of-counter', 
    Posts.find(), 
    {uniqueFunction: function(post){
      return post.referrerId + '-' + post.userId;
    });

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions