We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
const field = "name, JSON_EXTRACT(info, '$.age') AS age"; 在我这里这样写不行,必须是下面才行 const field = "name, JSON_EXTRACT(info, '$.age') AS info";
select(options, cache) { if (!this.config.jsonFormat) { return super.select(options, cache); }
return Promise.all([ super.select(options, cache), this.schema.getSchema() ]).then(([data, schema]) => { const keys = Object.keys(schema).filter(key => schema[key].tinyType === 'json'); (Array.isArray(data) ? data : [data]).forEach(row => { keys.filter(key => row[key] !== undefined).forEach(key => { row[key] = JSON.parse(row[key]); }); }); return data; });
}
keys 返回的是 [info] 而 row 里返回的 age:{} keys.filter(key => row[key] !== undefined) row[info] 必然是 undefined。
The text was updated successfully, but these errors were encountered:
能否重新整理下内容,看不懂你在表达什么?
Sorry, something went wrong.
No branches or pull requests
const field = "name, JSON_EXTRACT(info, '$.age') AS age";
在我这里这样写不行,必须是下面才行
const field = "name, JSON_EXTRACT(info, '$.age') AS info";
select(options, cache) {
if (!this.config.jsonFormat) {
return super.select(options, cache);
}
}
keys 返回的是 [info]
而 row 里返回的 age:{}
keys.filter(key => row[key] !== undefined)
row[info] 必然是 undefined。
The text was updated successfully, but these errors were encountered: