You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Type '{ score: { $meta: string; }; }' is not assignable to type 'string | { [key: string]: SortOrder; }'.
Types of property 'score' are incompatible.
Type '{ $meta: string; }' is not assignable to type 'SortOrder | undefined'.ts(2345)
Prerequisites
Mongoose version
6.3.5
Node.js version
16.14.2
MongoDB server version
4.2.3
Description
It is not possible to handle a text index search with sorting on the meta score like described in the MongoDB documentation: https://www.mongodb.com/docs/manual/core/text-search-operators/#query-framework
Typescript is complaining:
Steps to Reproduce
Mongoose typings should allow doing:
Expected Behavior
No Typescript error.
The text was updated successfully, but these errors were encountered: