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

adding JSON commands #29

Merged
merged 6 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/NRedisStack/Auxiliary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,19 @@ public static List<object> MergeArgs(RedisKey key, params RedisValue[] items)
foreach (var item in items) args.Add(item);
return args;
}

public static object[] AssembleNonNullArguments(params object?[] arguments)
{
var args = new List<object>();
foreach (var arg in arguments)
{
if (arg != null)
{
args.Add(arg);
}
}

return args.ToArray();
}
}
}
6 changes: 3 additions & 3 deletions src/NRedisStack/Bloom/BloomCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public bool[] Insert(RedisKey key, RedisValue[] items, int? capacity = null,
throw new ArgumentOutOfRangeException(nameof(items));

var args = BloomAux.BuildInsertArgs(key, items, capacity, error, expansion, nocreate, nonscaling);

return _db.Execute(BF.INSERT, args).ToBooleanArray();
}

Expand Down Expand Up @@ -335,7 +335,7 @@ public async Task<bool> ReserveAsync(RedisKey key, double errorRate, long capaci
/// <param name="iterator">Iterator value; either 0 or the iterator from a previous invocation of this command.</param>
/// <returns>Tuple of iterator and data.</returns>
/// <remarks><seealso href="https://redis.io/commands/bf.scandump"/></remarks>
public Tuple<long,Byte[]> ScanDump(RedisKey key, long iterator)
public Tuple<long, Byte[]> ScanDump(RedisKey key, long iterator)
{
return _db.Execute(BF.SCANDUMP, key, iterator).ToScanDumpTuple();
}
Expand All @@ -347,7 +347,7 @@ public Tuple<long,Byte[]> ScanDump(RedisKey key, long iterator)
/// <param name="iterator">Iterator value; either 0 or the iterator from a previous invocation of this command.</param>
/// <returns>Tuple of iterator and data.</returns>
/// <remarks><seealso href="https://redis.io/commands/bf.scandump"/></remarks>
public async Task<Tuple<long,Byte[]>> ScanDumpAsync(RedisKey key, long iterator)
public async Task<Tuple<long, Byte[]>> ScanDumpAsync(RedisKey key, long iterator)
{
var result = await _db.ExecuteAsync(BF.SCANDUMP, key, iterator);
return result.ToScanDumpTuple();
Expand Down
498 changes: 498 additions & 0 deletions src/NRedisStack/Json/IJsonCommands.cs

Large diffs are not rendered by default.

Loading