【问题标题】:How to store and query events in redis by date, user and specific fields?如何按日期、用户和特定字段在redis中存储和查询事件?
【发布时间】:2022-01-11 11:04:12
【问题描述】:

我想创建一个可以存储事件的系统,通过一些事件字段来获取它们。

这是架构:

public class Event
{
    public int UserId { get; set; }
    public DateTime From {get; set;}
    public DateTime To {get;set;}
    public bool IsAllDay
    // any other properties
}

如何组织 Redis 以便能够存储这些事件并按 UserIdFrom-To(日期范围)和 IsAllDay 字段? 我也想同时查询多个参数

【问题讨论】:

    标签: redis


    【解决方案1】:

    您想查看Redisearch 这将允许您对 Redis 哈希中的字段运行查询

    【讨论】:

      猜你喜欢
      • 2018-09-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-11
      • 1970-01-01
      • 2013-03-06
      相关资源
      最近更新 更多