rethinkdb / rethinkdb-ts

RethinkDB TypeScript driver
Apache License 2.0
123 stars 17 forks source link

Type 'string[]' is not assignable to type 'MultiFieldSelector'. #81

Closed BannerBomb closed 3 years ago

BannerBomb commented 3 years ago

Describe the bug When using TypeScript the "pluck" should be able to accept an object with keys that have an array of strings according to the ReQL documentations here. Such as

.pluck({ key: ['nested_key', 'second_nested_key', ...] })

but instead, it errors with the following

Type 'string[]' is not assignable to type 'MultiFieldSelector'.
  Type 'string[]' is not assignable to type '{ [property: string]: MultiFieldSelector; }'.
    Index signature is missing in type 'string[]'.ts(2322)

To Reproduce Steps to reproduce the behavior:

Expected behavior Any method that allows providing nested object values, should also be allowed to accept the shorthand form.

Screenshots image image

System info

Additional context Add any other context about the problem here.

atassis commented 3 years ago

Fixed in v2.4.10, try it