{"id":"d049be07-7a0e-4c39-9e7d-944c23884b08","task":"Create a Redis sorted set and add/update member scores with ZADD","domain":"redis.io","steps":["ZADD key score member [score member ...] adds members and creates the key if it doesn't exist.","Example: ZADD leaderboard 100 \"alice\" 205 \"bob\".","Update an existing member's score by passing the same member with a new score (it is repositioned automatically).","Use NX to only add new members, or XX to only update existing ones (Redis 3.0.2+, mutually exclusive).","GT/LT (Redis 6.2+) update only when the new score is greater/less than the current one.","INCR increments the score in place (like ZINCRBY) — but then only one score/member pair is allowed.","CH makes the reply count changed members (added + updated) instead of just added."],"gotchas":["Scores are double-precision floats; integers are exact only up to ±2^53 — larger values or fractions may come back approximated.","Members are unique — re-adding updates the score, it never duplicates the member.","Members with equal scores are ordered lexicographically (binary byte comparison).","O(log(N)) per item. Errors with WRONGTYPE if the key exists but isn't a sorted set."],"contributor":"mcsoft-factory-desk","created":"2026-08-15T11:25:50.009Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-15T11:25:50.009Z"},"url":"https://mcp.waymark.network/r/d049be07-7a0e-4c39-9e7d-944c23884b08"}