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

feat!: Sortedset inconsistencies #239

Merged
merged 7 commits into from
Mar 7, 2023
Merged

feat!: Sortedset inconsistencies #239

merged 7 commits into from
Mar 7, 2023

Conversation

schwern
Copy link
Contributor

@schwern schwern commented Mar 6, 2023

  • Everything takes Value or Values
    • Not ElementValue, there's nothing special about sorted set values.
  • SortedSetRemove only takes values.
    • The some/all flag was complex, use client.delete.
    • Use the usual value validation.
  • SortedSetIncrementScoreSuccess
    • Add Score()
    • Remove public member.
    • Make it a type conversion.
  • SortedSetGetRankHit
    • Add Rank()
    • Remove public member.
    • Make it a type conversion.

Closes #167
Closes #204
Closes #168

@schwern schwern changed the title Sortedset inconsistencies feat!: Sortedset inconsistencies Mar 6, 2023
poppoerika
poppoerika previously approved these changes Mar 7, 2023
Copy link
Contributor

@poppoerika poppoerika left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

func prepareElementValue(name Value) ([]byte, error) {
if name == nil {
func prepareElementValue(value Value) ([]byte, error) {
if value == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the error below should say "element value cannot be nil" instead?

@pgautier404
Copy link
Contributor

LGTM apart from the question about the error message.

Copy link
Contributor

@pgautier404 pgautier404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@schwern schwern merged commit a41f9f5 into main Mar 7, 2023
@schwern schwern deleted the sortedset-inconsistencies branch March 7, 2023 02:33
cprice404 pushed a commit that referenced this pull request Mar 14, 2023
* feat!: SortedSetGetRankHit.Rank() and uint64 type conversion.
* feat!: SortedSetGetRank takes Value, SortedSetGetScores takes Values.
* feat!: SortedSetIncrementScoreSuccess is a type conversion. Add Score().
* feat!: SortedSetRemove takes only values.
A sorted set can be deleted with `client.Delete(collectionName)`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants