loopbackio / loopbackio/loopback-next
Custom repository collection/table name
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 5.1k
- 派生
- 1.1k
- 平均合并
- 2 天 21 小时
- 30 天内合并 PR
- 27
描述
Currently the name of the collection is specified in the model, through the setting property of the model decorator.
I have two repositories, one storing the current version of the data, the other storing all versions of the data. Right now when I use the create method from those repo, they try to save into the same collection, creating errors.
I would like to store the model in different collections.
Also see this issue, probably code related.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
先从 issue 中描述的 model decorator 的 setting 属性和 repository create 方法入手,然后查看相关 issue #2197 以了解实现背景。当使用同一 model 的两个 repository 能够在不同的 collection 或 table 中持久化且互不冲突,并在现有行为经过测试的所有位置补充适当的 coverage 后,工作即完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript
- 领域
- backend, database
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100