@@ -325,6 +325,165 @@ public interface IDatabase : IRedis, IDatabaseAsync
325
325
/// <remarks><seealso href="https://redis.io/commands/hexists"/></remarks>
326
326
bool HashExists ( RedisKey key , RedisValue hashField , CommandFlags flags = CommandFlags . None ) ;
327
327
328
+ /// <summary>
329
+ /// Set the remaining time to live in milliseconds for the given set of fields of hash
330
+ /// After the timeout has expired, the field of the hash will automatically be deleted.
331
+ /// </summary>
332
+ /// <param name="key">The key of the hash.</param>
333
+ /// <param name="hashFields">The fields in the hash to set expire time.</param>
334
+ /// <param name="expiry">The timeout to set.</param>
335
+ /// <param name="when">under which condition the expiration will be set using <see cref="ExpireWhen"/>.</param>
336
+ /// <param name="flags">The flags to use for this operation.</param>
337
+ /// <returns>
338
+ /// Empty array if the key does not exist. Otherwise returns an array where each item is the result of operation for given fields:
339
+ /// <list type="table">
340
+ /// <listheader>
341
+ /// <term>Result</term>
342
+ /// <description>Description</description>
343
+ /// </listheader>
344
+ /// <item>
345
+ /// <term>2</term>
346
+ /// <description>Field deleted because the specified expiration time is due.</description>
347
+ /// </item>
348
+ /// <item>
349
+ /// <term>1</term>
350
+ /// <description>Expiration time set/updated.</description>
351
+ /// </item>
352
+ /// <item>
353
+ /// <term>0</term>
354
+ /// <description>Expiration time is not set/update (a specified ExpireWhen condition is not met).</description>
355
+ /// </item>
356
+ /// <item>
357
+ /// <term>-1</term>
358
+ /// <description>No such field exists.</description>
359
+ /// </item>
360
+ /// </list>
361
+ /// </returns>
362
+ ExpireResult [ ] HashFieldExpire ( RedisKey key , RedisValue [ ] hashFields , TimeSpan expiry , ExpireWhen when = ExpireWhen . Always , CommandFlags flags = CommandFlags . None ) ;
363
+
364
+ /// <summary>
365
+ /// Set the time out on a field of the given set of fields of hash.
366
+ /// After the timeout has expired, the field of the hash will automatically be deleted.
367
+ /// </summary>
368
+ /// <param name="key">The key of the hash.</param>
369
+ /// <param name="hashFields">The fields in the hash to set expire time.</param>
370
+ /// <param name="expiry">The exact date to expiry to set.</param>
371
+ /// <param name="when">under which condition the expiration will be set using <see cref="ExpireWhen"/>.</param>
372
+ /// <param name="flags">The flags to use for this operation.</param>
373
+ /// <returns>
374
+ /// Empty array if the key does not exist. Otherwise returns an array where each item is the result of operation for given fields:
375
+ /// <list type="table">
376
+ /// <listheader>
377
+ /// <term>Result</term>
378
+ /// <description>Description</description>
379
+ /// </listheader>
380
+ /// <item>
381
+ /// <term>2</term>
382
+ /// <description>Field deleted because the specified expiration time is due.</description>
383
+ /// </item>
384
+ /// <item>
385
+ /// <term>1</term>
386
+ /// <description>Expiration time set/updated.</description>
387
+ /// </item>
388
+ /// <item>
389
+ /// <term>0</term>
390
+ /// <description>Expiration time is not set/update (a specified ExpireWhen condition is not met).</description>
391
+ /// </item>
392
+ /// <item>
393
+ /// <term>-1</term>
394
+ /// <description>No such field exists.</description>
395
+ /// </item>
396
+ /// </list>
397
+ /// </returns>
398
+ ExpireResult [ ] HashFieldExpire ( RedisKey key , RedisValue [ ] hashFields , DateTime expiry , ExpireWhen when = ExpireWhen . Always , CommandFlags flags = CommandFlags . None ) ;
399
+
400
+ /// <summary>
401
+ /// For each specified field, it gets the expiration time as a Unix timestamp in milliseconds (milliseconds since the Unix epoch).
402
+ /// </summary>
403
+ /// <param name="key">The key of the hash.</param>
404
+ /// <param name="hashFields">The fields in the hash to get expire time.</param>
405
+ /// <param name="flags">The flags to use for this operation.</param>
406
+ /// <returns>
407
+ /// Empty array if the key does not exist. Otherwise returns the result of operation for given fields:
408
+ /// <list type="table">
409
+ /// <listheader>
410
+ /// <term>Result</term>
411
+ /// <description>Description</description>
412
+ /// </listheader>
413
+ /// <item>
414
+ /// <term>> 0</term>
415
+ /// <description>Expiration time, as a Unix timestamp in milliseconds.</description>
416
+ /// </item>
417
+ /// <item>
418
+ /// <term>-1</term>
419
+ /// <description>Field has no associated expiration time.</description>
420
+ /// </item>
421
+ /// <item>
422
+ /// <term>-2</term>
423
+ /// <description>No such field exists.</description>
424
+ /// </item>
425
+ /// </list>
426
+ /// </returns>
427
+ long [ ] HashFieldGetExpireDateTime ( RedisKey key , RedisValue [ ] hashFields , CommandFlags flags = CommandFlags . None ) ;
428
+
429
+ /// <summary>
430
+ /// For each specified field, it removes the expiration time.
431
+ /// </summary>
432
+ /// <param name="key">The key of the hash.</param>
433
+ /// <param name="hashFields">The fields in the hash to remove expire time.</param>
434
+ /// <param name="flags">The flags to use for this operation.</param>
435
+ /// <returns>
436
+ /// Empty array if the key does not exist. Otherwise returns the result of operation for given fields:
437
+ /// <list type="table">
438
+ /// <listheader>
439
+ /// <term>Result</term>
440
+ /// <description>Description</description>
441
+ /// </listheader>
442
+ /// <item>
443
+ /// <term>1</term>
444
+ /// <description>Expiration time was removed.</description>
445
+ /// </item>
446
+ /// <item>
447
+ /// <term>-1</term>
448
+ /// <description>Field has no associated expiration time.</description>
449
+ /// </item>
450
+ /// <item>
451
+ /// <term>-2</term>
452
+ /// <description>No such field exists.</description>
453
+ /// </item>
454
+ /// </list>
455
+ /// </returns>
456
+ PersistResult [ ] HashFieldPersist ( RedisKey key , RedisValue [ ] hashFields , CommandFlags flags = CommandFlags . None ) ;
457
+
458
+ /// <summary>
459
+ /// For each specified field, it gets the remaining time to live in milliseconds.
460
+ /// </summary>
461
+ /// <param name="key">The key of the hash.</param>
462
+ /// <param name="hashFields">The fields in the hash to get expire time.</param>
463
+ /// <param name="flags">The flags to use for this operation.</param>
464
+ /// <returns>
465
+ /// Empty array if the key does not exist. Otherwise returns the result of operation for given fields:
466
+ /// <list type="table">
467
+ /// <listheader>
468
+ /// <term>Result</term>
469
+ /// <description>Description</description>
470
+ /// </listheader>
471
+ /// <item>
472
+ /// <term>> 0</term>
473
+ /// <description>Time to live, in milliseconds.</description>
474
+ /// </item>
475
+ /// <item>
476
+ /// <term>-1</term>
477
+ /// <description>Field has no associated expiration time.</description>
478
+ /// </item>
479
+ /// <item>
480
+ /// <term>-2</term>
481
+ /// <description>No such field exists.</description>
482
+ /// </item>
483
+ /// </list>
484
+ /// </returns>
485
+ long [ ] HashFieldGetTimeToLive ( RedisKey key , RedisValue [ ] hashFields , CommandFlags flags = CommandFlags . None ) ;
486
+
328
487
/// <summary>
329
488
/// Returns the value associated with field in the hash stored at key.
330
489
/// </summary>
0 commit comments