meteor-mongo-minimongo

Installation
SKILL.md

Mongo and Minimongo

Meteor ships two implementations of the Mongo API in one codebase. The server talks to MongoDB through an async driver. The client runs Minimongo, an in-memory synchronous Mongo emulator that holds the documents that subscriptions have shipped.

Decision flow

  1. Where does this code run?
    • Server-only: use await Collection.*Async(...).
    • Client-only: use Collection.*(...) synchronously.
    • Isomorphic (import in shared code): use await Collection.*Async(...). On the client the work is local but still Promise-based; on the server it talks to Mongo.
  2. Does the query select more than a page of documents? Add { limit, skip } and an index that matches the selector.
  3. Are you reading from a publication on the client? Use find().fetch() (sync) without await. The data is already local.
Installs
33
GitHub Stars
7
First Seen
12 days ago
meteor-mongo-minimongo — meteor/agent-skills