-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add missing examples for Python and Node #1227
Conversation
3f1113b
to
f7322cb
Compare
node/src/BaseClient.ts
Outdated
* | ||
* @example | ||
* ```typescript | ||
* // Example usage of the hincrby method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy comment from incrBy
- it is more verbose
node/src/BaseClient.ts
Outdated
* | ||
* @example | ||
* ```typescript | ||
* // Example usage of the hincrbyfloat method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy from incrByFloat
* @example | ||
* ```typescript | ||
* // Example usage of configGet method with multiple configuration parameters | ||
* const result = await client.configGet(["timeout", "maxmemory"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Show example with wildcard
* connection.customCommand(["CLIENT", "LIST","TYPE", "PUBSUB"], "allPrimaries") | ||
* ```typescript | ||
* // Example usage of customCommand method to retrieve pub/sub clients with routing to all primary nodes | ||
* const result = await client.customCommand(["CLIENT", "LIST", "TYPE", "PUBSUB"], "allPrimaries"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a constant for allPrimaries
?
@@ -238,6 +238,10 @@ async def set( | |||
If the value is successfully set, return OK. | |||
If value isn't set because of only_if_exists or only_if_does_not_exist conditions, return None. | |||
If return_old_value is set, return the old value as a string. | |||
|
|||
Example: | |||
>>> await client.set("key", "value") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
show options in example
@@ -275,6 +283,13 @@ async def delete(self, keys: List[str]) -> int: | |||
|
|||
Returns: | |||
int: The number of keys that were deleted. | |||
|
|||
Examples: | |||
>>> await client.set("key", "value") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can omit set
I think
>>> await client.delete("key") | ||
1 | ||
>>> await client.delete("key") | ||
0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy "Indicates ..." comments from node docs - they are pretty good
node/src/RedisClient.ts
Outdated
* ```typescript | ||
* // Example usage of ping method with a message | ||
* const result = await client.ping("Hello"); | ||
* console.log(result); // Output: "Hello" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: please be consistent with one or two quotes, here it's
// Output: "Hello"
and other places it's:
// Output: 'Connection Name'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job 🔥
Please fix @Yury-Fridlyand and @acarbonetto comments before merging.
Does it also reformat all existing typescript examples?
Co-authored-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Yury-Fridlyand <[email protected]>
Co-authored-by: Yury-Fridlyand <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Yury-Fridlyand <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>
Co-authored-by: Andrew Carbonetto <[email protected]>
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.