Skip to content

Commit 4cf2920

Browse files
authored
Merge pull request #11893 from coyotte508/patch-4
fix(types): Allow sorting by text score
2 parents 238431e + 38c4f13 commit 4cf2920

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

types/query.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ declare module 'mongoose' {
579579
snapshot(val?: boolean): this;
580580

581581
/** Sets the sort order. If an object is passed, values allowed are `asc`, `desc`, `ascending`, `descending`, `1`, and `-1`. */
582-
sort(arg?: string | { [key: string]: SortOrder } | undefined | null): this;
582+
sort(arg?: string | { [key: string]: SortOrder | { $meta: 'textScore' } } | undefined | null): this;
583583

584584
/** Sets the tailable option (for use with capped collections). */
585585
tailable(bool?: boolean, opts?: {

0 commit comments

Comments
 (0)