Skip to content
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

null check to oldField search #33

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

vikas-patel
Copy link

Targeted to Fix the following Issue:
When search index is added to an old field in the schema.
Old Schema:
module.exports = {
type: 'timestamp',
}
New Schema:
module.exports = {
type: 'timestamp',
search: { type: ['NUMERIC', 'SORTABLE'] }
}
UpdateSchema command throws following error:
12|db | 2021-02-23T13:06:15: ReplyError: ERR Error running script (call to f_c545816098685cc5496530e85c8ac77be99fa5a2): @user_script:1089: user_script:1089: attempt to index field 'search' (a nil value)
12|db | 2021-02-23T13:06:15: at parseError (/home/vikas/repos/v2/node_modules/redis-parser/lib/parser.js:193:12)
12|db | 2021-02-23T13:06:15: at parseType (/home/vikas/repos/v2/node_modules/redis-parser/lib/parser.js:303:14) {
12|db | 2021-02-23T13:06:15: command: 'EVALSHA',
12|db | 2021-02-23T13:06:15: args: [
12|db | 2021-02-23T13:06:15: 'c545816098685cc5496530e85c8ac77be99fa5a2',
12|db | 2021-02-23T13:06:15: 0,
12|db | 2021-02-23T13:06:15: 'undefined:cb63e8d1-504c-4aac-a38c-ee40e7cea971',

As a fix added the null check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants