loopbackio / loopbackio/loopback-connector-sqlite3

Exception when object field not included in fields list of find or findOne

未关闭
#34 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
JavaScript
星标
13
派生
21
PR 合并指标
30 天内没有已合并 PR

描述

Bug or feature request
  • [X ] Bug
  • Feature request
Description of feature (or steps to reproduce if bug)
  1. Define a model with {field1: {type: 'number}, field2: {type: object'}}
  2. Create a model record
  3. 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)

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,在链接的 loopback-connector-sqlite3 示例中使用包含数字字段和对象字段的模型重现该问题,然后跟踪仅请求 field1 时的 find 和 findOne 入口点。完成标准是使用 fields: ['field1'] 获取记录时不会出现 JSON 解析异常并成功完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, sqlite
领域
database
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。