Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 类型化存储库查找选项_Node.js_Typeorm - Fatal编程技术网

Node.js 类型化存储库查找选项

Node.js 类型化存储库查找选项,node.js,typeorm,Node.js,Typeorm,我试图遵循此信息,但无法指定任何列出的选项(选择、关系、顺序),并出现以下错误: Object literal只能指定已知属性,并且“FindConditions”类型中不存在“where” 其中成为关系或顺序取决于指定的第一个选项 this.reportRepository.find({ where: {}, relations: ['fss'], order: {date_created: 'DESC'}, }); TypeOR@0.2.7这个错误有点误导,结果是我在order

我试图遵循此信息,但无法指定任何列出的选项(选择、关系、顺序),并出现以下错误:

Object literal只能指定已知属性,并且“FindConditions”类型中不存在“where”

其中成为关系或顺序取决于指定的第一个选项

this.reportRepository.find({
  where: {},
  relations: ['fss'],
  order: {date_created: 'DESC'},
});

TypeOR@0.2.7

这个错误有点误导,结果是我在order子句中使用了数据库列名而不是实体属性名,因此产生了这个错误。因此,指向where和not date_created的错误给我带来了一些麻烦。您没有在
where
中指定任何条件,因此可能会导致问题。