Typeorm Sqlite: запрос записей, больших или равных указанной дате - PullRequest
0 голосов
/ 21 февраля 2020

Я хочу запросить записи, большие или равные "2020-02-13 16:05:08" из базы данных Sqlite3. Я попробовал код ниже:

import { format} from 'date-fn' ;
const loadedMerchantprofiles = await merchantprofileRepo.find({ 
        updated_at: MoreThanOrEqual( format(new Date('2020-02-13 16:05:08'), "YYYY-MM-DD HH:mm:ss" ) ) 
        });

Это выдает ошибку времени компиляции ниже:

(property) updated_at?: FindOperator<never> | FindConditions<any> | FindOperator<FindConditions<any>>
No overload matches this call.
  Overload 1 of 2, '(options?: FindManyOptions<Merchantprofile>): Promise<Merchantprofile[]>', gave the following error.
    Argument of type '{ updated_at: FindOperator<string>; }' is not assignable to parameter of type 'FindManyOptions<Merchantprofile>'.
      Object literal may only specify known properties, and 'updated_at' does not exist in type 'FindManyOptions<Merchantprofile>'.
  Overload 2 of 2, '(conditions?: FindConditions<Merchantprofile>): Promise<Merchantprofile[]>', gave the following error.
    Type 'FindOperator<string>' is not assignable to type 'FindOperator<never> | FindConditions<any> | FindOperator<FindConditions<any>>'.
      Type 'FindOperator<string>' is not assignable to type 'FindOperator<never>'.
        Type 'string' is not assignable to type 'never'.ts(2769)
abstractcolumn.model.ts(72, 5): The expected type comes from property 'updated_at' which is declared here on type 'FindConditions<Merchantprofile>'
...