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

[Question] Problem Sending Large Commands to Redis for RedisGraph Module #1148

Closed
tombatron opened this issue May 18, 2019 · 4 comments
Closed

Comments

@tombatron
Copy link
Contributor

Hey there!

While trying to mess around with the RedisGraph module I encountered a 23 byte limit when trying to execute an admittedly large command using ExecuteAsync.

RedisResult result;

using (var connectionMultiplexer = ConnectionMultiplexer.Connect("localhost"))
{
    var database = connectionMultiplexer.GetDatabase();

    var query = "GRAPH.QUERY MotoGP \"CREATE (:Rider {name:'Valentino Rossi'})-[:rides]->(:Team {name:'Yamaha'}), (:Rider {name:'Dani Pedrosa'})-[:rides]->(:Team {name:'Honda'}), (:Rider {name:'Andrea Dovizioso'})-[:rides]->(:Team {name:'Ducati'})\"";

    result = await database.ExecuteAsync(query);
}

My question is, is there another recommended way to send comically large commands to Redis?

Thanks,

Tom

@mgravell
Copy link
Collaborator

The command here is just GRAPH.QUERY, with the parameters sent separately. There is a params object[] args for this purpose. Note that anything that is classed as a key should be sent as RedisKey values, to ensure routing works correctly, especially on "cluster".

@mgravell
Copy link
Collaborator

I think this means, in your case:

result = await database.ExecuteAsync("GRAPH.QUERY",
    (RedisKey)"MotoGP", "CREATE...");

so, one command with two arguments, the first of which is a key.

@tombatron
Copy link
Contributor Author

Welp I feel a bit foolish.

In any case, thank you for your assistance!

@mgravell
Copy link
Collaborator

mgravell commented May 18, 2019 via email

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