A Meteor package for publishing real-time counts of MongoDB cursors, optimized for small datasets.
Publish Counts is a Meteor package that allows developers to publish the count of documents in a MongoDB cursor to the client in real time. It solves the problem of displaying live, reactive counts (such as unread notifications or total posts) without manual polling or page refreshes. The package is optimized for smaller datasets (around 100 documents) to maintain performance and real-time accuracy.
Meteor developers building applications that require real-time count displays, such as dashboards, social feeds, or admin panels where live data metrics are essential.
Developers choose Publish Counts for its simplicity, real-time reactivity, and seamless integration with Meteor's pub/sub system. It provides a straightforward API and template helpers, making it easier to implement live counts compared to manual solutions or more complex scalable alternatives.
Meteor package to help you publish the count of a cursor, in real time
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically updates counts on the client when documents change, providing immediate feedback without manual polling, as highlighted in the real-time count publishing feature.
Supports counting documents, summing numeric fields with countFromField, or summing array lengths with countFromFieldLength, offering versatility beyond simple counts.
Includes template helpers like getPublishedCount and hasPublishedCount for seamless display of counts in Meteor's Blaze templates, simplifying UI development.
Provides options such as nonReactive for static counts and noReady for publication readiness control, allowing optimization based on specific use cases.
Designed for small datasets (around 100 documents); using it on larger collections can maximize server CPU and cause database timeouts, as explicitly warned in the README.
When using accessor functions for deeply nested fields, developers must manually limit fetched fields in cursors, increasing setup complexity and risk of inefficiency.
v1.x only compatible with Meteor 3.0+, which may force upgrades or limit use in legacy projects, as noted in the breaking changes section.