-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strict type decleration for PropertyName causing tsc compile error #2229
Comments
For a little more context; Index creation: roughly equivalent ft.search: |
Have the same problem.
// packages/search/lib/commands/index.ts:137
export type PropertyName = `${'@' | '$.'}${string}`;
export type SortByProperty = PropertyName | {
BY: PropertyName;
DIRECTION?: 'ASC' | 'DESC';
}; Even in examples it is used without $. or @ Environment:
|
Fixed in #2343. I'll comment here again once it's released |
I'm working on a project using typescript and created an index using json. Each json object has a unix timestamp, and I wanted to filter as well as sort objects with timestamps from the last 5 mins which led to the code below;
At least when compiling from ts this will cause a compilation error due to the lack of a @ or $. prefix before 'timestamp' as the SORTBY argument. This can be fixed quite easily by packages/search/lib/commands/index.ts line 126 to
... And it works for me just as intended.
I'm unfamiliar with the codebase and started working with redis the other night so I wonder if there would be any unintended consequences to such a change.
Environment:
The text was updated successfully, but these errors were encountered: