We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66e0d9f commit 0aac16aCopy full SHA for 0aac16a
test/types/queries.test.ts
@@ -719,8 +719,9 @@ async function gh15526() {
719
720
const selection = ['name'] as const satisfies readonly (keyof UserType)[];
721
722
+ type SelectType = Pick<UserType, (typeof selection)[number]>;
723
const u1 = await UserModel.findOne()
- .select<Pick<UserType, (typeof selection)[number]>>(selection)
724
+ .select<SelectType>(selection)
725
.orFail();
726
expectType<string | undefined | null>(u1.name);
727
expectError(u1.age);
0 commit comments