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

(error) ERR Operation against a key holding the wrong kind of value #20

Open
sillygwailo opened this issue Feb 4, 2012 · 2 comments
Open

Comments

@sillygwailo
Copy link
Contributor

In the data structures chapter, you get us to create a couple of sets, friends:leto and friends:duncan. In the next section, you get us to add scores to the set items, using zadd friends:leto 100 ghanima etc. I get the following error, though:

(error) ERR Operation against a key holding the wrong kind of value

Are sets and sorted sets completely different data structures? I was able to get through the chapter by choosing a different name for the sorted lists (zadd sfriends etc.) and couldn't find anything online to support the assertion that sets and sorted sets are two distinct data types.

@karlseguin
Copy link
Owner

I changed the key to friends:duncan. I agree using the same key is a mistake/wrong.

They are two distinct types. The chapter starts off with "The last and most powerful data structure are sorted sets. If hashes are like strings but with fields, then sorted sets are like sets but with a score.."....My initial instinct is that that's pretty clear...do you think changing the key is enough, or do you think I should look at further emphasizing that it's a different data type?

@sillygwailo
Copy link
Contributor Author

I think you should look at further emphasizing the difference in data types. Sort of too bad, because I think the Redis project chose names poorly. Set and Sorted Set sound like one is an extension of the other, and also implies some compatibility. Anyway, I think it would be clearer if you used a different key and data, since the similarities between friends:leto and friends:duncan imply that the data types are similar. (I know, completely different keys as far as Redis is concerned. But the same 'prefix' makes the implication.) So maybe something else, like ranking of people within the House of Atreides (or Harkonnen if rankings are more obvious in the series) for example.

cub-uanic referenced this issue in cubuanic-books/the-little-redis-book Mar 14, 2012
Вычитка: введение, 1 глава, 5 глава, заключение
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

2 participants