类型''的参数不能分配给类型'FindConditions <Entity>'的参数TypeOrm顺序

时间:2019-10-22 09:33:23

标签: node.js mongodb typescript orm typeorm

我正在尝试按mongodb _id字段降序排列。我的查询如下:

Cookie cookie = new Cookie("yourCookieName", null);
cookie.setPath("/your-projectName"); //we need to provide same path 
                                     //as we had at time of creation
cookie.setMaxAge(0);//max age is set to 0
response.addCookie(cookie);

但是它一直给我错误:

import plotly.graph_objects as go
import numpy as np

x = np.linspace(0, 50, 5000)

period1 = np.sin(10*x)
period2 = 5*np.sin(x)
noise = 2 * np.random.random(len(x)) - 1
period1_noise = period1 + noise
total = period2 + period1_noise

fig = go.Figure()
fig.add_trace(go.Scatter(
    x=x,
    y=total,
    name='Sine'
))

fig.update_layout(xaxis_rangeslider_visible=True)
fig.show()

模型文件是

this.vehicleRepository.findOne({
                        where : 
                           {
                            "vin": vin.vin,
                            "userId": user.Id
                        },
                        order: {
                            id : "DESC"
                        }
                    });

存储库为:

Argument of type '' is not assignable to parameter of type 'FindConditions<Entity>' TypeOrm Order 

TypeORM版本是

import { Column, Entity, ObjectID, ObjectIdColumn } from 'typeorm';

@Entity()
export class Vehicle {

   @ObjectIdColumn()
    public id: ObjectID;
}

任何帮助将不胜感激!!!

0 个答案:

没有答案