typescript - 如果我们使用猫鼬,我们应该在nestJS中使用没有typeorm的实体吗
问题描述
所以,我没有使用 TypeOrm 而是使用 mongoose 用于 mongodb。我创建的接口对使用 Pipes 没有任何好处,因为接口是 typescript 的行为,而不是 Javascript 的行为。
我有架构和文档,但这也没有涉及很多函数参数。
我收到类似的错误
'UserDocument' only refers to a type, but is being used as a value here
(上面的 UserDocument 是在架构文件中创建的export type UserDocument = User & Document;
)
如果我们使用猫鼬 ORM 并且我们制作的文档(使用export type UserDocument = User & Document;
或通过制作接口)不适用于 NestJS 中的大多数功能,那么好的做法是什么。
解决方案
推荐阅读
- elixir - 长生不老药 lua 日历在 shitf_zone 时显示不同的行为
- java - 方法不存在类链接问题:在两个链接的 Java 项目中从具有相同名称和项目路径的类调用方法时
- linux - dnssec-dsfromkey 显示未知算法错误
- json - 使用 Node.js Express 检查 POST 正文请求语法和格式
- angular6 - Angular Elements:一个功能模块项目结构中的几个自定义 Web 组件可能吗?
- git - bitbucket 上的拉取请求不会触发竹子上的构建
- api - session_start():无法发送会话cookie - 已发送的标头。在发布请求的codeigniter rest-server api liberay中
- c# - WCF:SqlConnectionStringBuilder 中没有密码 - 为什么它起作用?
- node.js - 环回框架中远程方法的默认值
- ruby - 迭代哈希数组以根据另一个哈希键对一个哈希值的值求和