-
Notifications
You must be signed in to change notification settings - Fork 41
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 bloom (BF) commands #3
Conversation
} | ||
|
||
public bool Exists(RedisKey key, string item) | ||
public bool Exists(RedisKey key, RedisValue item) | ||
{ | ||
return _db.Execute(BF.EXISTS, key, item).ToString() == "1"; |
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.
What happens when this fails and an exception is raised (if the module isn't present, for example).
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.
It will return false.
What would you expect to happen?
|
||
List<object> args = new List<object> { key }; | ||
|
||
foreach (var item in items) |
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.
Any reason you can't concat these two types of lists, rather than loop? Is it possible to do a:
args.Concat(items).ToList
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.
"Concat" and "AddRange" only works for Enumerable, and RedisValue[] is not Enumerable (it's also not working for input of type List<RedisValue>
).
I haven't found a more elegant way than this..
I can Change it to:items.ForEach(item => args.Add(item));
Tell me if it's better in your opinion
|
||
List<object> args = new List<object> { key }; | ||
|
||
foreach (var item in items) |
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.
Same question re: concat
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.
Same answer re: concat ;)
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.
This PR contains some JSON along with the bloom filters. Can we slice this, only into that Bloom goal. Ideally we'd like small, surgical PRs.
Secondly - let's add docstrings everywhere - including links to our commands pages on redis.io.
@chayim