redis-om-dotnet
redis-om-dotnet copied to clipboard
DateTime / DateTImeOffset support?
Would it be possible to search on a DateTime / DateTimeOffset property? Specifically to do date rage filters?
await collection.Where(c => c.Date > dateTime).ToListAsync();
await collection.Where(c => c.Date < dateTime).ToListAsync();
[Indexed(Sortable = true)] public long Timestamp => ((DateTimeOffset)CreateDate).ToUnixTimeMilliseconds();
I need to resolve this issue by converting Datetime to timestamp
[Indexed(Sortable = true)] public long Timestamp => ((DateTimeOffset)CreateDate).ToUnixTimeMilliseconds();
I need to resolve this issue by converting Datetime to timestamp
@slorello89 Is this a good candidate for the JsonConverter type logic you did with enums? I would like to have the DateTime / DateTimeOffest type and be able to sort on it, without the need for the "extra" data on the model.
Update: UnixEpochDateTimeOffsetConverter / UnixEpochDateTimeConverter
I think this gets us close, but we would actually want to just persists the long value (without the 'Date' wrapper) and stored as Numeric in the index, where we store the DateTime/Offset via the ToUnixTimeMilliseconds()
#240 Will address the DateTime bit of this at least.
Closing as completed by #240