agentsclimarketplace

Mongodb changestream field filter

Skill kjuhwa/skills-hub/skills/backend/mongodb-changestream-field-filter

Self-correcting knowledge corpus for Claude Code — 9 stable shape clusters, bias-correction pipeline baked into contribution flow. 47 papers, 45 techniques, 1.1k skills.

Install
npx -y skills add kjuhwa/skills-hub --skill mongodb-changestream-field-filter

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Filter MongoDB change stream UPDATE events by inspecting updateDescription.updatedFields so irrelevant mutations do not trigger downstream work; INSERT/DELETE fall through as always-relevant.

SKILL.md

1.9 KB, 314 tokens by cl100k_base, as published. Nobody here has run it

MongoDB Change Stream Field Filter

Shape

Listener receives ChangeStreamDocument. For UPDATE, read updateDescription.updatedFields (a BsonDocument of dottedPath → value). Return a boolean isRelevant before handing off to the expensive processor.

Steps

  1. Register listener via Spring Data MongoDB (reactive or blocking driver).
  2. Branch on OperationType: INSERT / DELETE → always relevant.
  3. UPDATEupdatedFields = event.getUpdateDescription().getUpdatedFields().
  4. Exact check: updatedFields.containsKey("groupId").
  5. Nested/wildcard: updatedFields.keySet().stream().anyMatch(k -> k.startsWith("tags.")).
  6. Combine with OR over the "relevant fields" set; return the boolean.
  7. Not relevant → log TRACE and skip. Relevant → delegate to processor.
  8. Persist resumeToken so reconnection skips already-seen events.

Counter / Caveats

  • updatedFields is keyed by dotted path at the leaf changed. A whole-subdoc replace shows as "parent", not "parent.child" — handle both.
  • Full-document replaces ($set on root) may surface every field as "updated"; treat as relevant.
  • Never skip DELETEs on field filter — there are no fields to inspect.
  • Network hiccup / replica-set election → stream goes silent without exception; pair with mongodb-changestream-resubscribe knowledge.

What ships with it: 1 file

602 B alongside SKILL.md

Keep looking

Skills are one crate of 327,069. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.