Click here to Skip to main content
15,920,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in this lanecode i have an error:
Inmueble.find({ usuario: id }).skip(Number(desde)).limit(Number(limite)).sort(orden),


in previous versions of typescript it worked correctly for me but with the new versions it no longer works for me


console:
src/controllers/inmuebles.ts:133:83 - error TS2345: Argument of type 'string | string[] | ParsedQs | ParsedQs[]' is not assignable to parameter of type 'string | { [key: string]: SortOrder | { $meta: "textScore"; }; } | null | undefined'.
  Type 'string[]' is not assignable to type 'string | { [key: string]: SortOrder | { $meta: "textScore"; }; } | null | undefined'.    Type 'string[]' is not assignable to type '{ [key: string]: SortOrder | { $meta: "textScore"; }; }'.
      Index signature is missing in type 'string[]'.

133     Inmueble.find({ usuario: id }).skip(Number(desde)).limit(Number(limite)).sort(orden),





how should i replace it?


What I have tried:

in this lanecode i have an error:
<pre>Inmueble.find({ usuario: id }).skip(Number(desde)).limit(Number(limite)).sort(orden),


in previous versions of typescript it worked correctly for me but with the new versions it no longer works for me


console:
src/controllers/inmuebles.ts:133:83 - error TS2345: Argument of type 'string | string[] | ParsedQs | ParsedQs[]' is not assignable to parameter of type 'string | { [key: string]: SortOrder | { $meta: "textScore"; }; } | null | undefined'.
  Type 'string[]' is not assignable to type 'string | { [key: string]: SortOrder | { $meta: "textScore"; }; } | null | undefined'.    Type 'string[]' is not assignable to type '{ [key: string]: SortOrder | { $meta: "textScore"; }; }'.
      Index signature is missing in type 'string[]'.

133     Inmueble.find({ usuario: id }).skip(Number(desde)).limit(Number(limite)).sort(orden),





how should i replace it?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900