loopbackio / loopbackio/loopback-next

Custom repository collection/table name

未关闭
#2,844 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

feature good first issue Hacktoberfest Repository
主要语言
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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 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

把新 issue 发到你的邮箱

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