Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Ability to store multiple values together to increment or decrement. statsCounter #4

Open
amp127 opened this issue Oct 29, 2024 · 0 comments

Comments

@amp127
Copy link

amp127 commented Oct 29, 2024

I'm tracking 15 different things for each org and often will increment or decrement multiple values within one mutation. The current use doesn't scale great, especially when you need sharding. A Stats like mode would be great.

In the ideal state this would be most helpful:
const statsForOrg = statsCounter.for("w57tj7fretc11ct91frbqwf2qh721exr");
await statsForOrg.inc(ctx, 'views'); // increment
await statsForOrg.dec(ctx, 'spentTokens'); // decrement
await statsForOrg.add(ctx, 'rank', 5); // add 5
await statsForOrg.subtract(ctx, 'tokens' , 2); // subtract 2
await statsForOrg.getAll(ctx)
await statsForOrg.estimateCounts(ctx, "w57tj7fretc11ct91frbqwf2qh721exr")
await statsForOrg.rebalance(ctx, "w57tj7fretc11ct91frbqwf2qh721exr");

however having the value support a string or v.any would allow for similar manual programming of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant