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 32bb9a2 commit 18b1e78Copy full SHA for 18b1e78
test/types/models.test.ts
@@ -9,6 +9,7 @@ import {
9
UpdateQuery,
10
CallbackError,
11
HydratedDocument,
12
+ LeanDocument,
13
Query
14
} from 'mongoose';
15
import { expectAssignable, expectError, expectType } from 'tsd';
@@ -457,5 +458,5 @@ async function gh12286() {
457
458
const User = model<IUser>('User', schema);
459
460
const user = await User.findById('0'.repeat(24), { name: 1 }).lean();
- expectType<IUser | null>(user);
461
+ expectType<LeanDocument<IUser & { _id: ObjectId; }> | null>(user);
462
}
0 commit comments