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 SetFromFile and SetFromDirectory Commands for Json Files #40

Merged
merged 9 commits into from
Nov 17, 2022

Conversation

shacharPash
Copy link
Contributor

No description provided.

@shacharPash shacharPash requested a review from chayim November 14, 2022 08:29
@shacharPash shacharPash marked this pull request as ready for review November 14, 2022 08:29

//creating json string:
var obj = new Person { Name = "Shachar", Age = 23 };
string json = JsonSerializer.Serialize(obj);
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 in the case the content cannot be serialized as json?

@shacharPash shacharPash changed the title Add Set File Command for Json Files Add SetFromFile and SetFromDirectory Commands for Json Files Nov 15, 2022
/// <inheritdoc/>
public int SetFromDirectory(RedisValue path, string filesPath, When when = When.Always)
{
int inserted = 0;
Copy link

Choose a reason for hiding this comment

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

This one looks too specific to me.. I don't think we should implement this function

BTW, I think that the users will want to warp all the SetFromFile calls with a MULTI

Copy link
Contributor

Choose a reason for hiding this comment

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

I can agree on a multi. We have this in python - hence wanted to get it into other clients.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will implement support for Transactions and pipelines in the future and then I will change this command

@shacharPash shacharPash merged commit 2bcd398 into master Nov 17, 2022
@shacharPash shacharPash deleted the JsonFeatures branch November 17, 2022 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants