Fix indexing and querying GUID lists #403
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is a problem when using [Indexed]
List<Guid>
right now - index for them is not created, and querying is not working. This will fix this.However, as I can see right now, current aprroach is quite bad - you have to manually add new types and it's possible to forget to add it in one place or another.
And I had to spend a few hours to find out, why
List<Guid>
is not working, there was no indication from RedisOM that I'm doing something wrong.Also, you probably can't cover all types, that can be indexed: user can use for indexing any signle-line field (DateTime, DateTimeOffset, Enum, Uri, and the list goes on, not to mention it's possible to create custom types). All these types can be serialized as valid JSON single-line fields (string or number)
So, you need to check not the base type, but the JSON-serialized type of the object (with JsonConverter attribute, if it's there). This seems to be a complex task, so I'll leave it to you =)