loopbackio / loopbackio/loopback-connector-sqlite3
Exception when object field not included in fields list of find or findOne
未关闭
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 13
- 派生
- 21
- PR 合并指标
- 30 天内没有已合并 PR
描述
Bug or feature request
- [X ] Bug
- Feature request
Description of feature (or steps to reproduce if bug)
- Define a model with {field1: {type: 'number}, field2: {type: object'}}
- Create a model record
- Retrieve the model record with fields: ['field1']
Link to sample repo to reproduce issue (if bug)
https://github.com/aams/loopback-connector-sqlite3
Expected result
No crash
Actual result (if bug)
Exception "Uncaught SyntaxError: Unexpected token u in JSON at position 0"
Additional information (Node.js version, LoopBack version, etc)
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,在链接的 loopback-connector-sqlite3 示例中使用包含数字字段和对象字段的模型重现该问题,然后跟踪仅请求 field1 时的 find 和 findOne 入口点。完成标准是使用 fields: ['field1'] 获取记录时不会出现 JSON 解析异常并成功完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, sqlite
- 领域
- database
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100