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
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".
I think this means, in your case:
c#
result = await database.ExecuteAsync("GRAPH.QUERY",
(RedisKey)"MotoGP", "CREATE...");
so, one command with two arguments, the first of which is a key.
Welp I feel a bit foolish.
In any case, thank you for your assistance!
No problem. If you hit any more stumbling blocks, please let us know. If
anything, it means we're not making the API obvious enough
On Sat, 18 May 2019, 22:40 Tommy Hanks, notifications@github.com wrote:
Closed #1148
https://github.com/StackExchange/StackExchange.Redis/issues/1148.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/StackExchange/StackExchange.Redis/issues/1148?email_source=notifications&email_token=AAAEHMFPNQV76AY6RYZ6L3LPWBZUVA5CNFSM4HN3BKA2YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGORQR3UWI#event-2351151705,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAEHMFLYFR2K4FGZHE6NTLPWBZUVANCNFSM4HN3BKAQ
.
Most helpful comment
I think this means, in your case:
c# result = await database.ExecuteAsync("GRAPH.QUERY", (RedisKey)"MotoGP", "CREATE...");
so, one command with two arguments, the first of which is a key.