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

FastAPI Tutorial: Give some more background on Redis #22308

Closed
aeschli opened this issue Oct 24, 2023 · 1 comment
Closed

FastAPI Tutorial: Give some more background on Redis #22308

aeschli opened this issue Oct 24, 2023 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug documentation triage-needed Needs assignment to the proper sub-team verified Verification succeeded
Milestone

Comments

@aeschli
Copy link

aeschli commented Oct 24, 2023

Testing #22302

I'm looking at the 'Replace the database' section. I'm new to Redis.

It explains nicely what line I need to replace with what, but I'm puzzled of what the new code means and how redis works.

redis_client.hincrby(f"item_id:{item_id}", "quantity", quantity)

what does this call do? What is hincrby. What's the effect to the database?

Maybe it is easier to start with the set:

redis_client.hset(
            f"item_id:{item_id}",
            mapping={
                "item_id": item_id,
                "item_name": item_name,
                "quantity": quantity,
            })

This seems to store an object with multiple properties. And hincrby allows to increment one of the properties?

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Oct 24, 2023
@luabud luabud self-assigned this Oct 24, 2023
@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug documentation labels Oct 24, 2023
@luabud
Copy link
Member

luabud commented Oct 25, 2023

Thank you so much for the feedback! I completely agree. I added a bit more of explanation around Redis and its methods throughout that section (microsoft/vscode-docs@5b8cdfc). I also added more explanation about the hashes we'd be using right in the beginning of the session, to try to make the whole edits clearer.

@luabud luabud closed this as completed Oct 25, 2023
@luabud luabud added this to the October 2023 milestone Oct 25, 2023
@gregvanl gregvanl added the verified Verification succeeded label Oct 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug documentation triage-needed Needs assignment to the proper sub-team verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants