/meteor:meteor-mongo-minimongofrom Meteor
Helps write and debug Mongo queries in Meteor 3, covering server async vs client Minimongo sync, oplog vs change streams, indexes, selectors, modifiers, and projections.
Ships in Meteor. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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.
await Collection.*Async(...).Collection.*(...) synchronously.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.{ limit, skip }
and an index that matches the selector.find().fetch()
(sync) without await. The data is already local.const doc = await Posts.findOneAsync(id);
const list = await Posts.find({ ownerId }, {
fields: { title: 1 }, sort: { createdAt: -1 }, limit: 50,
}).fetchAsync();
const count = await Posts.find({ ownerId }).countAsync();
const _id = await Posts.insertAsync({ title, ownerId });
await Posts.updateAsync({ _id }, { $set: { title } });
await Posts.removeAsync({ _id });
The async API is isomorphic. Prefer it in shared code so the same line works on the server.
const doc = await Posts.findOneAsync(id); // works in shared/client/server
const list = await Posts.find({ ownerId }).fetchAsync();
On the client, the operation reads in-memory Minimongo but the async API still
returns a real Promise. Code after await resumes in a later microtask. The
sync API also works client-side, but only there:
const doc = Posts.findOne(id); // client-only
const list = Posts.find({ ownerId }).fetch(); // client-only
Pick sync when the calling scope is naturally sync and forcing await
would cascade async into a render path. Common cases:
Pick async (findOneAsync, fetchAsync) when the file might also run on
the server, or the containing function is already async.
Indexes are server-side. Create them on app startup:
import { Meteor } from "meteor/meteor";
import { Posts } from "/imports/api/posts";
Meteor.startup(async () => {
await Posts.createIndexAsync({ ownerId: 1, createdAt: -1 });
await Posts.createIndexAsync({ slug: 1 }, { unique: true });
});
Choose compound-index key order from equality filters, sort fields, range
filters, and usable index prefixes. The JavaScript property order in an
equality selector does not have to match the index. Verify the chosen plan in
the Mongo shell (meteor mongo) with
db.posts.find(...).explain("executionStats").
The core driver boundary is release-specific:
| Meteor | Reactive behavior |
|---|---|
| 3.0 through 3.4 | Uses oplog when MONGO_OPLOG_URL is configured; otherwise polling. Core change streams and reactivity-order settings are unavailable. |
| 3.5+ | Chooses a driver per query in the default order below. |
Meteor 3.5+ defaults to:
changeStreams -> oplog -> polling
With [email protected] (Meteor 3.6), change streams require MongoDB 6.0.9+
or 7+ on a replica set or sharded cluster. Earlier Meteor 3.5 packages accept
MongoDB 6+ but lack split-event handling and the new resync fence holds.
History-loss resynchronization already exists in the 3.5.3 source. Check
.meteor/versions for package updates/backports before selecting guidance.
All versions require an unordered observer, no skip or limit, and a
selector Minimongo can compile. An ineligible query or server falls through
to the next configured driver. Oplog requires MONGO_OPLOG_URL and its own
query eligibility check. A paginated query rejected by Change Streams is not
automatically polling-only; retain eligible oplog fallback.
On MongoDB 6.0.8, do not force 3.6's Change Streams driver. Verify the selected oplog/polling fallback or plan a database upgrade with backups and compatibility checks. See large events and recovery for fragmented events, lost history and write-fence reconciliation.
Meteor 3.6 with [email protected] also declines
$where/$near selectors for Change Streams: live events cannot be re-matched
with MongoDB semantics by Minimongo. Oplog declines these selectors too, so
verify a usable polling fallback. Minimongo-incompatible projections also
require fallback. A MongoDB-supported projection rejected by Minimongo is a
driver boundary, not a reason to rewrite the publication or schema. Verify
fallback before proposing that broader change. Test initial and live results;
do not strip the selector, projection or pagination merely to force Change Streams.
The 3.5.5 backport ([email protected]) also declines $where/$near.
Earlier 3.5 packages can choose the wrong driver;
on a constrained release, use a supported polling configuration or an
authorized compatible upgrade and rerun the exact query.
Meteor 3.4.4, 3.5.5 and 3.6.1 add further live-selector guards for $type,
negated $elemMatch, PCRE-only regexes and divergent collations. Preserve
the query and verify polling, using the exact package pairs and earlier-version
branches in selector compatibility.
On Meteor 3.5+, override the app-wide order with
METEOR_REACTIVITY_ORDER=oplog,polling or:
{
"packages": {
"mongo": {
"reactivity": ["oplog", "polling"]
}
}
}
On Meteor 3.5+, the disable-oplog package removes only the oplog step. It
does not disable change streams. Use reactivity: ["polling"] to force
polling. On Meteor 3.0 through 3.4, do not add these settings; upgrade first.
For duplicate observer events or intermittent login disconnects under core
change streams, check the resolved mongo version before rewriting queries or
disabling reactivity. [email protected] (Meteor 3.5.2) fixes replay of events already
covered by a causal primary snapshot. Earlier 3.5 packages lack that fix;
upgrade and rerun the failing sequence. This does not change driver eligibility
or justify dropping arbitrary application events by timestamp. Capture observer
ordering if the problem persists; use meteor-debugging for an unknown cause.
Use collation for locale-aware or case-insensitive selectors and sorting on
both Mongo and Minimongo. Back the server query with an index created using
the same collation:
const collation = { locale: "en", strength: 2 };
const users = await Users.find(
{ email: "[email protected]" },
{ collation },
).fetchAsync();
await Users.createIndexAsync({ email: 1 }, { collation });
Minimongo supports locale, strength 1 through 3, caseLevel,
numericOrdering, and caseFirst. Other Mongo collation options are
server-only and are ignored by Minimongo.
findOne, insert, update, remove) in shared code.
Breaks the moment the file is imported on the server.find on the server. Always limit.fields projection when publishing. Always project.references/server-vs-client.mdreferences/selectors-modifiers.mdreferences/eval-cases.mdWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub meteor/agent-skills --plugin meteor17 skills in this plugin
/meteor-accountsUse when wiring up authentication in a Meteor 3 app. Triggers on accounts-password, accounts-base, OAuth (Google, Facebook, GitHub, Apple, Twitter, Meetup, Weibo), accounts-2fa, accounts-passwordless, ServiceConfiguration.configurations.upsertAsync, Accounts.createUserAsync, Accounts.setPasswordAsync, Accounts.forgotPassword, Accounts.resetPassword, Accounts.verifyEmail, useHttpOnlyCookies, clientStorage, Meteor.loginWithPasswordAnd2faCode, email verification, accounts-express, authFetchAllowedOrigins. Use this skill when the user asks about signups, signins, or asks about token storage vs HttpOnly cookies.
/meteor-blazeUse when building or debugging Meteor 3 Blaze interfaces: meteor create --blaze, Spacebars, helpers/events, lifecycle, Tracker, ReactiveVar/ReactiveDict, subscriptions, Promise helpers, #let states, Template.dynamic, Blaze.render, and blaze-hot HMR. Triggers on stale async results, lost reactivity after await, data-context lookup surprises, duplicate DOM integrations, Rspack full reloads, raw HTML in triple braces, jQuery not found, Expected template or null, Template.instance() is null after await, missing event.dataTransfer, Reactive HTML attributes, BLOCKOPEN, TRIPLE template tag, Expected "li" end tag, or Template can't be named. Use this skill when asked about reusable Blaze components, the Blaze PWA scaffold, package/backend selection, Rspack entry imports, or template tests. For Meteor 2 to 3 upgrades, use migrate-to-meteor-3; for unexplained cross-layer failures, meteor-debugging.
/meteor-cli-installationUse when installing, locating, repairing, resetting, or uninstalling the Meteor CLI for Meteor 3 development. Triggers on "meteor: command not found", npx meteor, installer failures, PATH problems, specific Meteor versions, clean reinstall requests, meteor reset, or corrupted dev bundles. Use this skill when the user asks about fresh workstation setup or making a local Meteor command available. For application failures after the CLI starts, use meteor-debugging; for application code upgrades, use migrate-to-meteor-3.
/meteor-community-packagesUse when choosing, evaluating, adopting, configuring, or debugging a package from Meteor's documented community catalog, or moving from a community package to a promoted core package such as roles. Triggers on community package recommendations, Atmosphere vs npm selection, Packosphere maintenance checks, jam:* helpers, Meteor.publish.once, Meteor.publish.stream, meteor-rpc, Wormhole, cluster, mail-preview, meteor add --search, or adopting a Git-hosted Atmosphere package. Use this skill when the user asks which maintained package fits or how its documented integration works. Route Meteor 2-to-3 package failures to migrate-to-meteor-3 and underlying core API design to its owning skill.
/meteor-debuggingUse when diagnosing an unexplained failure in a Meteor 3 application before the failing layer or fix is known. Triggers on server crashes, client-only errors, Errors prevented startup, Meteor App - Error, stuck subscriptions, DDP or WebSocket disconnects, Minimongo/server data mismatches, hanging or flaky tests, slow builds, --inspect, console.log, .only, Playwright traces, Instrumentation lifecycle events, or requests to debug a Meteor app. Use this skill when evidence must distinguish Meteor tool, server, client, data, test, browser, mobile, or production boundaries. For test setup and authoring use meteor-testing; after confirming a domain cause, hand the repair to the owning skill.
/meteor-deploymentUse when deploying a Meteor 3 application. Triggers on meteor build, meteor deploy, Galaxy Push to Deploy, Galaxy Mode, Repository Mode, DEPLOY_HOSTNAME, Docker, Kubernetes, settings.json, METEOR_SETTINGS, MONGO_URL, MONGO_OPLOG_URL, ROOT_URL, PORT, HTTP_FORWARDED_COUNT, NODE_OPTIONS, health checks, pre-deploy commands, hot code push, --architecture os.linux.x86_64, --server-only, or a deployed Node.js version mismatch. Use this skill when the user asks about shipping the app, asks about production config, or asks about containerizing. For Cordova Android/iOS artifacts, signing, and native HCP compatibility use meteor-native; this skill owns the backend deployment.
Other plugins' skills for the same job