Publish Counts

screenshot of Publish Counts

Meteor package to help you publish the count of a cursor, in real time

Overview

The publish-counts package is designed to help users easily track and publish the count of documents from a cursor in real-time. It is intended for smaller datasets with a limited number of documents, around 100, due to its real-time capabilities. The package should not be used to count all documents in large datasets to avoid maximizing server CPU usage when multiple clients connect.

Features

  • API Functions: Offers functions like Counts.publish, Counts.get, and Counts.has for easy counting and retrieval of counter values.
  • Observer Handle: Provides an observer handle that can be used to maintain the counter and stop the observer from running if needed.
  • Options Parameter: Allows users to customize counting behavior with options like noReady, nonReactive, and countFromField.

Summary

The publish-counts package offers a convenient solution for real-time counting and tracking of document counts from a cursor in Meteor applications. With its API functions, customizable options, and observer handle, users can efficiently manage and display document counts without overloading the server. However, it is important to note the package's suitability for smaller datasets to avoid performance issues.