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

Add bloom (BF) commands #3

Merged
merged 12 commits into from
Aug 4, 2022
Merged

Add bloom (BF) commands #3

merged 12 commits into from
Aug 4, 2022

Conversation

shacharPash
Copy link
Contributor

}

public bool Exists(RedisKey key, string item)
public bool Exists(RedisKey key, RedisValue item)
{
return _db.Execute(BF.EXISTS, key, item).ToString() == "1";
Copy link
Contributor

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).

Copy link
Contributor Author

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)
Copy link
Contributor

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

Copy link
Contributor Author

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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question re: concat

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same answer re: concat ;)

Copy link
Contributor

@chayim chayim left a 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 chayim merged commit 74a1fe0 into master Aug 4, 2022
@chayim chayim deleted the AddBloomCommands branch August 4, 2022 09:17
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

Successfully merging this pull request may close these issues.

2 participants