Skip to content

Commit 71f264d

Browse files
adding JSON commands (#29)
* adding JSON commands * Change commands names * some fixes * adding missing commands, removing visibility modifiers in interface * async breakout Co-authored-by: shacharPash <s.pashchur@gmail.com>
1 parent 083adb5 commit 71f264d

File tree

8 files changed

+2001
-71
lines changed

8 files changed

+2001
-71
lines changed

src/NRedisStack/Auxiliary.cs

+14
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,19 @@ public static List<object> MergeArgs(RedisKey key, params RedisValue[] items)
1010
foreach (var item in items) args.Add(item);
1111
return args;
1212
}
13+
14+
public static object[] AssembleNonNullArguments(params object?[] arguments)
15+
{
16+
var args = new List<object>();
17+
foreach (var arg in arguments)
18+
{
19+
if (arg != null)
20+
{
21+
args.Add(arg);
22+
}
23+
}
24+
25+
return args.ToArray();
26+
}
1327
}
1428
}

src/NRedisStack/Bloom/BloomCommands.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public bool[] Insert(RedisKey key, RedisValue[] items, int? capacity = null,
111111
throw new ArgumentOutOfRangeException(nameof(items));
112112

113113
var args = BloomAux.BuildInsertArgs(key, items, capacity, error, expansion, nocreate, nonscaling);
114-
114+
115115
return _db.Execute(BF.INSERT, args).ToBooleanArray();
116116
}
117117

@@ -335,7 +335,7 @@ public async Task<bool> ReserveAsync(RedisKey key, double errorRate, long capaci
335335
/// <param name="iterator">Iterator value; either 0 or the iterator from a previous invocation of this command.</param>
336336
/// <returns>Tuple of iterator and data.</returns>
337337
/// <remarks><seealso href="https://redis.io/commands/bf.scandump"/></remarks>
338-
public Tuple<long,Byte[]> ScanDump(RedisKey key, long iterator)
338+
public Tuple<long, Byte[]> ScanDump(RedisKey key, long iterator)
339339
{
340340
return _db.Execute(BF.SCANDUMP, key, iterator).ToScanDumpTuple();
341341
}
@@ -347,7 +347,7 @@ public Tuple<long,Byte[]> ScanDump(RedisKey key, long iterator)
347347
/// <param name="iterator">Iterator value; either 0 or the iterator from a previous invocation of this command.</param>
348348
/// <returns>Tuple of iterator and data.</returns>
349349
/// <remarks><seealso href="https://redis.io/commands/bf.scandump"/></remarks>
350-
public async Task<Tuple<long,Byte[]>> ScanDumpAsync(RedisKey key, long iterator)
350+
public async Task<Tuple<long, Byte[]>> ScanDumpAsync(RedisKey key, long iterator)
351351
{
352352
var result = await _db.ExecuteAsync(BF.SCANDUMP, key, iterator);
353353
return result.ToScanDumpTuple();

src/NRedisStack/Json/IJsonCommands.cs

+498
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)