简体   繁体   English

“数字”类型与“FindOneOptions”类型没有共同的属性<Client> &#39;

[英]Type 'number' has no properties in common with type 'FindOneOptions<Client>'

在此处输入图像描述

While creating a findOne request using typeorm i get this error, HELP!使用 typeorm 创建 findOne 请求时出现此错误,求助!

According to the TypeORM docs you need to call findOne like this (assuming clientId is also the name of the column in the Client table).根据TypeORM 文档,您需要像这样调用findOne (假设clientId也是Client表中列的名称)。

const client = await Client.findOne({
    where: {
        clientId: clientId
    }
});

The error message is telling you that it is expecting a FindOneOptions<Client> but you are giving it a number instead.错误消息告诉您它需要一个FindOneOptions<Client>但您却给它一个number

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 类型'{孩子:元素; }' 与类型 'IntrinsicAttributes' 没有共同的属性 - React 18.2.0 - Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes' - React 18.2.0 “string”类型与“clientStorageInterface”类型没有共同的属性 - Angular - Type 'string' has no properties in common with type 'clientStorageInterface' - Angular 类型'{孩子:元素; }' 与 react 布局组件上的类型 'IntrinsicAttributes' 没有共同的属性 - Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes' on react layout component 类型错误' ...在将js文件转换为tsx时与类型IntrinsicAttributes没有共同的属性 - Type error ' … has no properties in common with type IntrinsicAttributes while converting js file to tsx Typescript 样式组件错误:“类型 '{ children: string; }' 没有与类型 'IntrinsicAttributes' 相同的属性。” - Typescript styled-component error: "Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes'." 类型'{孩子:元素[]; }' 与 type 'IntrinsicAttributes' &amp; { className?: string | 没有共同的属性不明确的; }' - Type '{ children: Element[]; }' has no properties in common with type 'IntrinsicAttributes' & { className?: string | undefined; }' 当 Type B 以某种方式“扩展”Type A 时,如何停止 TypeScript 错误“Type A 没有与 Type B 相同的属性” - How to stop TypeScript error 'Type A has no properties in common with Type B' when Type B "extends" Type A in some way 错误TS2559:类型&#39;BookInterface []&#39;没有与&#39;BookInterface&#39;类型相同的属性 - error TS2559: Type 'BookInterface[]' has no properties in common with type 'BookInterface' 访问数字类型的未定义属性 - Access undefined properties on number type Typescript - 从 object 数组的公共属性创建自定义类型 - Typescript - Create custom type from common properties of an Array of object
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM