Support using array type in index key encoding #81
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.
Previously the
IndexEncoderwould be passedundefinedas the component in thetypeingenerateIndexKeyEncodingwas the name of the array type schema and wouldn't matchIndexTypeMap(the set of index types).This PR adds a wrapping
c.array()around the FQN of the key's type which resolves to the inner type. This only is supported when the key's array type is defined with a name. I.e., it has to be registered by itself and not nested.Querying using an array key is awkward because the key encodes the length of the array and the values in the array are encoded in order. IMHO this is acceptable since array keys are more advanced and if one needs to query against a subset of the property array values, they would need an index anyways to support that.